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
- Set
UsageLog:Folderto where the logs should go. - Load it at startup — put it in your
acaddoc.lsp.STARTUPBUILDin this library will build that file for you. - Work normally for a month.
- 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
| Name | UsageLog — record which custom LISP commands get used, and how often |
| Download | UsageLog.lsp — 15.2 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Commands | USAGELOGOFF, USAGELOGON |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com). |
| Source size | 15.2 KB, 378 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| Undo | Not needed — this routine only reads the drawing and changes nothing. |
| Compatibility | AutoCAD (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. |
| Author | YZ, August 2026 |
| Licence | Free 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