4.6Programming: AutoLISP & an introduction to advanced automation
To go all the way with automation, AutoCAD offers a historic and powerful language: AutoLISP. It's an integrated programming language that lets you create your own commands and automate complex repetitive tasks that simple scripts don't cover. Many « in-house » tools in design offices are LISP routines.
You don't need to be a developer to benefit: you can load and use existing routines (.lsp files, via APPLOAD), then, gradually, write your first small functions. AutoLISP gives you programmatic access to AutoCAD's geometry and commands. That's the peak of productivity: when a task keeps coming back, a routine does it in one click. (For heavier development, .NET and ObjectARX also exist.)
Section vocabulary
- AutoLISP
- Programming language built into AutoCAD, for creating commands and automating tasks.
- LISP routine (.lsp)
- AutoLISP program, often stored in a .lsp file, defining one or more custom commands.
- APPLOAD
- Command to load a LISP (or other) file so its functions become available.
- Custom command
- New command created through programming, callable like a native command.
- .NET / ObjectARX
- More powerful programming interfaces for developing complex AutoCAD applications.
In practice — Getting started with AutoLISP automation
- Get a simple, reliable LISP routine (.lsp) and load it with APPLOAD.
- Run the new command it defines and observe the gain on a repetitive task.
- Open the .lsp file in a text editor and identify its structure (defun, command calls).
- Write a very small personal function (e.g. a command that sets up layers or runs a sequence).
Key points to remember
- AutoLISP lets you create your own commands and automate complex tasks.
- You can load (APPLOAD) and use existing routines without being a developer.
- When a task keeps coming back, a routine does it in one click.
- For heavy development: .NET and ObjectARX.
Frequently asked questions
Do you need to know how to program to benefit from AutoLISP?
No for using existing routines: you just load them (APPLOAD) and call the command — countless free or in-house LISP routines exist for common tasks. To write your own routines, a few notions of logic are enough to start with small functions; then you progress. Even without becoming a developer, knowing how to load and use LISP routines is a major productivity asset.
Is AutoLISP outdated today?
No: although old, it remains massively used because it's simple, integrated and effective for automating AutoCAD on a daily basis. Thousands of routines circulate and many design offices rely on them. For more complex applications or rich interfaces, you use .NET (C#/VB) or ObjectARX (C++), which are more powerful. But for everyday automation, AutoLISP keeps an excellent simplicity/efficiency ratio.