• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

CMDSCOUT LISP: List a LISP File’s Commands Without Loading

August 3, 2026

CMDSCOUT lists every custom command defined by a LISP file without loading it. This becomes indispensable the moment a library passes about fifty routines — you are handed a .lsp file and you need to know what commands it would add before you commit to loading it.

What CommandScout does

Loading an unknown file has two risks. It might redefine a command you already rely on, quietly, so that TAPE stops doing what you expect. And it might run startup code you have not read, at load time, before you have typed anything at all.

Reading the file first removes both. You see the command list, decide, and load it or do not.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type CMDSCOUT.
  3. Choose the .lsp file to inspect.
  4. Read the list of commands it would define.

How it works

The file is read as plain text and scanned with a regular expression for the pattern that defines a command:

\(\s*defun\s+c:(\S+)

which reads as: an opening bracket, optional whitespace, the word defun, whitespace, c:, and then a capture of the run of non-space characters that follows — the command name.

Because this is pure text matching, no code from the file is ever evaluated. A file cannot do anything to your session merely by being inspected. That is the entire safety property, and it is why the routine reads rather than loads.

The regular expression engine and the file reader both come from Windows Scripting COM objects rather than from AutoLISP, which has no native regex support.

Notes and limits

  • It finds command definitions, not everything a file does. Helper functions, reactors and startup side effects are not commands and will not be listed.
  • A command defined by generated code will be missed. If a file builds a defun at run time rather than writing it literally, text matching cannot see it. That is rare, and it is the trade for never evaluating anything.
  • Windows only, because it uses Windows Scripting COM objects for the regular expression engine.
  • It reads the file and changes nothing — not the drawing, not your session, not the file itself.

Download and details

NameCommandScout — list the commands a LISP file defines, without loading it
DownloadCommandScout.lsp — 6.6 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandCMDSCOUT
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size6.6 KB, 163 lines
Error handlingYes — a *error* handler restores every system variable it changed, on cancel as well as on error.
UndoNot needed — this routine only reads the drawing and changes nothing.
CompatibilityAutoCAD (any release with AutoLISP), BricsCAD, ZWCAD, GstarCAD, ProgeCAD and other IntelliCAD-based platforms. AutoCAD LT needs a LISP enabler. No .NET, no ObjectARX, no installer.
AuthorYZ, August 2026
LicenceFree to use, supplied “as is” with no warranty.

References

  • USAGELOG LISP — record which commands actually get used
  • STARTUPBUILDER LISP — decide what loads automatically once you have chosen
  • More free AutoLISP routines on this site
  • Wisey’s Steel Shapes — free structural steel section drawing program

Filed Under: AutoLISP Routines

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (30)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (29)
  • AutoCAD Tutorials (54)
  • AutoLISP Routines (328)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (84)
  • Electrical Drafting (2)
  • General IT reference (7)
  • Geometry (15)
  • GIS (2)
  • Hatch Patterns (12)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (14)
  • Structural Drafting (26)
  • Technical Dictionary (61)
  • Useful Website Links (19)

Footer

Free downloads

  • Free AutoLISP routines
  • Free hatch patterns
  • SHX fonts & text styles
  • Numbering LISP collection
  • ISO 3098B font

Reference charts

  • AWS weld symbols chart
  • Steel detailing chart
  • Hole & slot sizes
  • Bolt edge distance
  • ANSI & ARCH paper sizes
  • How to fold an A1 drawing

Useful links

  • CAD blocks (DWG)
  • Revit families
  • structuraldrafter.com
  • cad-corner.com
  • About
  • Privacy policy

Provided for free with no warranty · Log in