CADEx

How to Auto-Load a LISP Routine When AutoCAD Starts

AutoCADCivil 3D5 min
Short answer

The simplest way to auto-load a LISP routine when AutoCAD starts is to add it to the Startup Suite under APPLOAD. For per-drawing initialization (running every time any DWG opens), add (load "yourfile.lsp") to acaddoc.lsp instead. For one-time session setup, use ACAD.lsp.

Steps

1

Decide session-level vs per-drawing

If your routine only needs to run once per AutoCAD session (loading a menu, defining shared functions), use the Startup Suite or ACAD.lsp. If it needs to run every time a drawing opens (setting layer state, registering reactors per-doc), use acaddoc.lsp.

2

Option A — Startup Suite

Type APPLOAD. Under Startup Suite, click Contents, Add, browse to your .lsp/.fas/.vlx, Open, Close. Done. This survives AutoCAD upgrades because the list is per-user, not per-install.

3

Option B — Edit ACAD.lsp

Locate ACAD.lsp on the support path (or create one in any trusted folder). Add a single line: (load "yourfile.lsp") — no path needed if the file is on the support path. AutoCAD loads ACAD.lsp once per session.

4

Option C — Edit acaddoc.lsp

Same as ACAD.lsp but the file is acaddoc.lsp. AutoCAD loads it every time a drawing opens, before S::STARTUP runs. Use this when your routine registers per-document reactors.

5

Confirm the folder is trusted

Whichever method you pick, the folder must be in Options → Files → Trusted Locations or AutoCAD will refuse to load without a prompt.

6

Verify by restarting AutoCAD

Close AutoCAD completely and reopen. Type your command name to confirm the routine loaded automatically. If it didn't, check the command-line history — load failures print there.

Frequently asked questions

Where does AutoCAD find ACAD.lsp?

Anywhere on the Support File Search Path (Options → Files). The first ACAD.lsp it finds wins. Putting yours in a folder that comes before %APPDATA%\Autodesk\... ensures yours runs.

Can I have multiple ACAD.lsp files?

AutoCAD loads only the first one it finds on the search path. To run multiple startup scripts, use one ACAD.lsp that (load)s the others, or use the Startup Suite which supports unlimited entries.

Should I define S::STARTUP myself?

Yes, but append to it rather than redefine. (defun S::STARTUP () (existing-startup) (my-init)) — replacing it breaks other plugins that also defined S::STARTUP.

Why isn't my acaddoc.lsp loading?

Three usual causes: folder isn't on the support path; folder isn't a Trusted Location; or another acaddoc.lsp earlier on the path shadows yours. Check the command line on drawing open — load errors show there.

Does any of this work in AutoCAD LT?

No. AutoCAD LT does not include the LISP interpreter. All four methods above require full AutoCAD or a vertical like Civil 3D, MEP, or Architecture.

Related guides

How to Load a LISP Routine in AutoCAD

Three reliable ways to load .lsp, .fas, and .vlx files into AutoCAD, plus how to add them to the Startup Suite so you never reload again.

Browse listings

AutoCAD LISP Routines

Hundreds of verified AutoLISP and Visual LISP routines for AutoCAD: .lsp source, compiled .fas, and bundled .vlx applications. Loaded with APPLOAD, version-friendly, malware-scanned.

Related terms

ACAD.lsp

A LISP file AutoCAD looks for on every session start and loads automatically — the standard place to autoload routines.

acaddoc.lsp

A LISP file AutoCAD loads every time a drawing is opened, used for per-document setup and (defun S::STARTUP).

S::STARTUP

A special LISP function name AutoCAD calls automatically after any drawing finishes loading.

APPLOAD

The AutoCAD command that opens a dialog for loading .lsp, .fas, .vlx, .arx, or .dll files into the current session.

Support File Search Path

The ordered list of folders AutoCAD scans to find LISP, font, menu, and template files.

Trusted Locations

AutoCAD's allow-list of folders that can load executable code (LISP, .NET, ARX) without a security warning.