How to Fix AutoLISP Routines Not Auto-Loading on Startup & SECURELOAD Prompts
Configure Trusted Locations (TRUSTEDPATHS), Startup Suite in APPLOAD, and gcaddoc.lsp / acaddoc.lsp so corporate AutoLISP tools load silently on every drawing open.
⚡ Quick Executive Fix
Add your LISP folder to both 'Support File Search Path' and 'Trusted Locations' in OPTIONS > Files, set SECURELOAD = 1, and place per-drawing initialization routines inside gcaddoc.lsp (or acaddoc.lsp) with ACADLSPASDOC = 1.
1. Engineering Root-Cause Diagnosis inside the AC1032 DWG Database
When an AutoLISP command works after manual `APPLOAD` in Drawing 1 but returns **`Unknown command`** as soon as the engineer opens Drawing 2—or displays an annoying *"Security - Unsigned Executable File"* popup on every startup—the issue lies in the distinction between **Session-Scoped (`gcad.lsp`/`acad.lsp`)** vs. **Document-Scoped (`gcaddoc.lsp`/`acaddoc.lsp`)** LISP namespaces and `TRUSTEDPATHS` governance.
2. Step-by-Step Resolution Protocol in AutoCAD & GstarCAD 2027
1. Whitelist Your Corporate LISP Folder in TRUSTEDPATHS
Open OPTIONS → Files, add your script directory (`C:\CAD_Standards\LISP\`) to **Support File Search Path**, and add the exact same path (with `\...` suffix for sub-folders: `C:\CAD_Standards\LISP\...`) to **Trusted Locations (`TRUSTEDPATHS`)**.
2. Understand gcaddoc.lsp vs. Startup Suite Namespace Persistence
Because each open `.dwg` runs in its own isolated LISP memory namespace (`VL-DOC`), functions loaded only once at startup won't propagate to newly opened drawings unless they are placed in **Startup Suite** (`APPLOAD → Contents`) or inside **`gcaddoc.lsp` / `acaddoc.lsp`** located in the top Support File Search Path.
3. Use autoload for Zero-Latency Startup
Instead of parsing 60 heavy `.lsp` files on every drawing open, put lightweight `(autoload "MyTool.lsp" '("CMD1" "CMD2"))` stubs inside `gcaddoc.lsp` so each `.lsp` file compiles on demand only when the user actually types the command.
3. Automated AutoLISP Diagnostic & Repair Script (gcaddoc.lsp)
Load the following production AutoLISP routine into GstarCAD 2027 or AutoCAD via APPLOAD (or add it to gcaddoc.lsp) to automate this repair across affected project files:
(vl-load-com)
;; Corporate gcaddoc.lsp - Executes automatically on EVERY drawing open in GstarCAD 2027
(setvar "ACADLSPASDOC" 1)
(setvar "SECURELOAD" 1)
;; Demand-load heavy engineering routines only when invoked by user
(autoload "FastClip.lsp" '("FASTCLIP"))
(autoload "TotalLen.lsp" '("TOTALLEN"))
(autoload "CleanMtext.lsp" '("CLEANMTEXT"))
(princ "\n[GstarCAD Enterprise] Loaded corporate AutoLISP command stubs.")
(princ)
4. Diagnostic System Variables & Edge-Case Matrix
| Failure Symptom / Scenario | Command / SysVar | Production Remediation Rule |
|---|---|---|
| LISP works in 1st drawing, fails in 2nd DWG | Use gcaddoc.lsp / Startup Suite |
gcaddoc.lsp runs in every document namespace; gcad.lsp runs only on 1st. |
| Security warning popup on every DWG open | TRUSTEDPATHS |
Add folder path with \... recursive wildcard to Trusted Locations. |
| Malicious acaddoc.lsp virus in vendor folder | SECURELOAD = 1 or 2 |
Blocks untrusted LISP files sitting inside external DWG project folders. |
Experience Faster, Corruption-Free DWG Engineering in GstarCAD 2027
Built by Suzhou Gstarsoft Co., Ltd. (SSE: 688657), GstarCAD 2027 features multi-threaded DWG open/save, built-in RegApp/Scale-List scrubbers, and perpetual licensing.