Use the builder below to generate ready-to-use AutoLISP routines. Fill in the form, click Build LISP, then copy and paste the code into AutoCAD's VLISP editor or a .lsp file.
Current layer name:
New layer name:
Layer name to make current:
Layer name:
Action:
Layer name:
Color (1–255):
Zoom method:
This routine runs PURGE ALL repeatedly until nothing more can be removed, then runs AUDIT to fix any errors. A standard pre-transmittal cleanup routine.
← Fill in the form and click Build LISP
How to Run LISP Code in AutoCAD
| Method | Steps | Best For |
|---|---|---|
| Command line (one-time) | Copy the code → paste at the AutoCAD command line → press Enter | Quick one-off use |
| APPLOAD command | Save code as a .lsp file → type APPLOAD → browse and load | Loading a routine you'll use regularly |
| VLISP editor | Type VLISP → paste code → Tools → Load Text in Editor | Debugging and development |
| Startup (acaddoc.lsp) | Add code to acaddoc.lsp in your AutoCAD support path | Auto-loading every session |
💡 Tip: After loading a routine with APPLOAD or VLISP, call it from the command line by typing its function name (e.g. if the code defines
(defun c:RELAY ...), type RELAY at the command line).📖 More LISP scripts: Visit the LISP Scripts page for a library of pre-built routines, or LISP Snippets for short code examples.