nestjsautodesk-forgeautodesk-designautomation

AutoLISP not loading in Design Automation AppBundle


I’m using Autodesk Design Automation v3 for AutoCAD, and I created a .bundle ZIP containing a custom batchplot.lsp. When I try to load and run it via SCR script in a WorkItem, I get the following errors:

[06/17/2025 12:35:46] Command: (load "batchplot.lsp")
[06/17/2025 12:35:46] ; error: LOAD failed: "batchplot.lsp"
[06/17/2025 12:35:46] Command: (c:batchplot)
[06/17/2025 12:35:46] ; error: no function definition: C:BATCHPLOT  

Here is how I zipped the AppBundle:
ListLayers2.bundle.zip

xml

<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage
  SchemaVersion="1.0"
  AutodeskProduct="AutoCAD"
  Name="ListLayers2"
  Description="Batch plotting LISP"
  AppVersion="1.0.0"
  ProductCode="AutoCAD"
  AppName="ListLayers2"
>
  <CompanyDetails
    Name="MyCompany"
    Url="http://example.com"
  />
  <Components>
    <RuntimeRequirements
      OS="Win64"
      Platform="AutoCAD*"
    />
    <ComponentEntry
      AppType="AutoLISP"
      ModuleName="./Contents/batchplot.lsp"
    />
  </Components>
</ApplicationPackage>

❗ What I want to know 1. Why is (load "batchplot.lsp") failing even though the file exists inside the AppBundle’s Contents folder?
2. Does the /al flag guarantee that the Contents folder becomes the current directory for LISP/SCR?
3. Is the AppBundle structure or SCR logic incorrect in any way?
Thank you


Solution

  • You need add Support elements to your runtime requirments, so it will know where to find your AutoLISP file.

    <Components>
        <RuntimeRequirements SupportPath="./Contents"
                             OS="Win64"
                             Platform="AutoCAD"
                             SeriesMin="R24.0"
                             SeriesMax="R24.3">
        </RuntimeRequirements>
        <ComponentEntry ModuleName="./Contents/Hello.lsp"
                        AppDescription="A sample lisp app for Design Automation for AutoCAD">
         
        </ComponentEntry>
      </Components>
    

    I have answered Running LISP on the APS Design API