• 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

USAGELOG LISP: Record Which LISP Commands Actually Get Used

August 3, 2026

USAGELOG records which of your custom LISP commands actually get used, and how often. The point of it is pruning.

What UsageLog does

Once a library runs to a hundred routines, nobody knows which ones earn their keep. Run this for a month and the answer is in a spreadsheet: the commands nobody has invoked once are candidates for deletion, and the ones used forty times a day are the ones worth polishing.

USAGELOGON starts logging; USAGELOGOFF stops it and discards anything not yet written. Logging starts automatically when the file loads.

One CSV is written per day, filed in a folder per month:

C:\LISP-Logs\AUGUST 2026\Log_20260802.csv

Each file lists, per drawing, every command used in it and the number of times. Folders are created automatically if they do not exist.

How to use it

  1. Set UsageLog:Folder to where the logs should go.
  2. Load it at startup — put it in your acaddoc.lsp. STARTUPBUILD in this library will build that file for you.
  3. Work normally for a month.
  4. Open the CSVs and see what is actually being used.

How it works

Counts accumulate in memory and are flushed to disk when the drawing is saved. That is a deliberate trade: writing on every command would mean a file operation on every single invocation, which would be felt.

It does mean an AutoCAD session that crashes without ever saving loses its counts — which is the honest cost of not making every command slower.

If a log already exists for today, its contents are read and merged rather than overwritten, so several drawings and several sessions in one day all accumulate into the same file.

The two logging commands themselves are excluded from the counts, since recording that you switched logging on is of no interest.

Notes and limits

  • Counts are written on save. A session that crashes before saving loses them.
  • Load it at startup or it measures nothing. It has to be running before the commands are used.
  • Set the folder first. The default may not suit.
  • Same-day logs are merged, not overwritten.

Download and details

NameUsageLog — record which custom LISP commands get used, and how often
DownloadUsageLog.lsp — 15.2 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandsUSAGELOGOFF, USAGELOGON
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size15.2 KB, 378 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

  • STARTUPBUILD LISP — build the acaddoc.lsp that loads this at startup
  • CMDSCOUT LISP — see what commands a file defines before adding it
  • STOPWATCH LISP — how long they take, rather than how often they run
  • 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