AutoCAD – Drawings

The appload command in AutoCAD: loading lisp without the warning

The appload command in AutoCAD loads lisp files. Here is the security dialog people actually hit, photographed on AutoCAD 2027, and how to stop it asking.

  • TS. Đỗ Quốc Hoàng
  • 8 min read
The dialog AutoCAD 2027 shows when a lisp file sits outside a trusted folder Photo: Screenshot taken on AutoCAD 2027 at the Institute

You download a lisp file, type AP, pick the file, click Load. The screen blinks and nothing happens; type the routine's command and the software says it does not know it. Or worse, an English dialog appears with three buttons and no obvious right answer.

That is why the appload command in AutoCAD draws so many searches with the word "error" attached. This article photographs that dialog on AutoCAD 2027 at the Institute, explains what it is asking, and shows how to stop it asking again. For the wider subject of automating drawings, the Institute runs an AutoCAD course for construction.

Where to start it

The table below was read out of the acad.cuix interface file of the 2027 release on the machine, not written from memory.

CommandAliasRibbonClassic menu
APPLOADAPManage → Applications → Load ApplicationTools → AutoLISP → Load Application
VLIDEnoneManage → Applications → Visual LISP EditorTools → AutoLISP → Visual LISP Editor
NETLOADnonenonenone

The alias is two letters, and this is one of the few everyday commands that does have a button on the default ribbon.

One thing we measured that we have not seen written anywhere: there is no hyphenated version. Type -APPLOAD and the reply is verbatim Unknown command "-APPLOAD". The command must go through its dialog, so it cannot be put in a script. Loading from the command line means using the AutoLISP (load "...") function instead.

Loading lisp in AutoCAD, step by step

The sequence is short, but one step gets skipped and causes most of the confusion.

StepWhat you doNote
1Type AP and press EnterThe Load/Unload Applications dialog opens
2Browse to the folder holding the .lsp fileKeep lisp files in one fixed folder, not in Downloads
3Select the file and click LoadSeveral files can be selected at once
4Read the status line at the bottom of the dialogIt says whether the load succeeded
5Close the dialog and type the routine's commandThe command name is chosen by whoever wrote the file

Step five is the common misunderstanding. A file called cat-dim.lsp does not mean you type cat-dim. The command lives in a (defun c:...) line inside the file and can be named anything at all. Open the file in Notepad, search for defun c:, and there is the name to type.

This is why people often think a load failed when it actually worked. Every lisp the Institute publishes states its command name at the top of the article, as in our piece on the dimension-trimming lisp.

Why the routine will not run

If what you met was an English dialog with a yellow triangle, this is it.

Its title is Security - Unsigned Executable File, and what it asks amounts to: the publisher of this file cannot be verified and the file is not in a trusted folder, so what would you like to do?

Press Do Not Load and the command line prints exactly one line:

; error: File load canceled: <path to the file>

That sentence is what a great many people then paste into a search box. It is not a fault in the lisp file and not a broken installation. It is AutoCAD's protection mechanism doing its job.

What decides it is the SECURELOAD variable. Autodesk describes it in one line on the SECURELOAD page for the 2027 release: "Controls whether executable files are restricted to being loaded from trusted folders only". Its default is 1 and it is saved in the Registry.

ValueWhat Autodesk says
0Loads from any location without a warning — "not recommended"
1Loads silently from trusted locations; warns for anywhere else
2Loads only from trusted locations; anywhere else is ignored

Because the default is 1, any lisp file you download into Downloads or onto the Desktop will trigger the question. That is normal behaviour, not a malfunction.

Three buttons: which one to press

The dialog offers three choices, and they differ more than they look.

Load Once loads it this time only. Next session the same question comes back. Right for a file you need once.

Always Load loads it and adds that folder to the trusted list, so the question never returns for anything in it. This is the button most people want, provided they know where the file came from.

Do Not Load refuses, and produces the error line above.

That proviso is not a formality. A lisp routine is executable code and can do anything on your machine, not merely in the drawing. Downloading a routine from an unknown source and pressing Always Load opens the door to whatever it contains. The Institute publishes the full source inside each article so it can be read before loading, as with our sequential numbering lisp.

Declaring trusted folders once and for all

The tidy approach is to gather every lisp file into one folder and declare that folder in TRUSTEDPATHS.

On our machine the variable holds three paths separated by semicolons. Add one more and everything inside it loads silently from then on.

SECURELOAD values and what we measured Photo: The three SECURELOAD values and four tests on AutoCAD 2027

We measured it both ways to be sure:

SituationWhat we measured
SECURELOAD 1, file in an unlisted folderDialog appears; refusing gives ; error: File load canceled:
SECURELOAD 1, folder declared in TRUSTEDPATHSLoads silently, no dialog at all

Those two rows are a matched pair: the same file, the same SECURELOAD value, only the location differing.

Through the interface: type OPTIONS, go to the Files tab, find Trusted Locations and add the folder. Quicker still is pressing Always Load once when the dialog appears, because AutoCAD adds the folder to the list for you.

Two places are trusted implicitly and never need declaring: the AutoCAD installation folder and the ApplicationPlugins folder, along with all their subfolders.

Do not set SECURELOAD to 0 merely for convenience. It switches the protection off across the whole machine, and Autodesk labels that option "not recommended" in plain words.

Other ways in, and what each is for

Besides AP there are several loading routes, each suited to a different job.

Drag and drop. Drag the .lsp file from a folder window onto the drawing area. Fastest of all, and it still passes through the same security check.

The (load ...) function. Typed straight on the command line, for example (load "C:/Lisp/catdim.lsp"). The path must use forward slashes, because AutoLISP reads a backslash as an escape character and swallows it. This is the only route that works inside a script, since -APPLOAD does not exist.

The startup suite. Inside the AP dialog there is a Contents section; files placed there load automatically every time AutoCAD starts. This is where a routine you use daily belongs.

acad.lsp and acaddoc.lsp. Autodesk's rule is that acad.lsp loads once at application startup while ACADLSPASDOC is 0, which is what we measured on our machine. Set it to 1 and the file reloads with every drawing opened. acaddoc.lsp, by contrast, always loads with each drawing whatever that variable says.

So there is no single right answer: AP for one-off work, the startup suite for daily tools, acaddoc.lsp for anything that must be present in every drawing.

Three things tutorials leave out

What people assumeWhat the 2027 release actually does
The warning means the lisp file is brokenNo. SECURELOAD defaults to 1 and blocks files outside trusted folders
Type the file name to run itType the name in (defun c:...), which is usually different
APPLOAD can go in a scriptThere is no -APPLOAD; the reply is Unknown command. Use (load ...)

In short, the appload command in AutoCAD is not the hard part; the security layer behind it is. Put every lisp in one fixed folder, press Always Load once, and add the daily ones to the startup suite. Do those three things and loading stops being something you think about.

Frequently asked questions

What is the alias for loading a lisp file?

AP, short for APPLOAD. There is also a button at Manage → Applications → Load Application.

It loaded, but the command is not recognised. Why?

The command name sits in the (defun c:...) line inside the file and is usually different from the file name. Open the file in Notepad to find it.

Which button should I press on the Security dialog?

Always Load if you trust the source, since it adds the folder to the trusted list. Load Once if you only need the file this once.

Should I set SECURELOAD to 0?

No. Autodesk calls that option "not recommended". Declaring the folder in TRUSTEDPATHS is safer and stops the prompts just as well.

How do I make a routine load every time AutoCAD starts?

Type AP and add the file to the Contents section of the startup suite.

Can APPLOAD be scripted for batch work?

No, because it only runs through its dialog and has no hyphenated form. Use (load "path/to/file.lsp") with forward slashes.

About the author

TS. Đỗ Quốc Hoàng — Vice Director of the Institute of Information Technology in Civil Engineering, Hanoi University of Civil Engineering, and a specialist in software development for construction