WHEREUSED answers the question PURGE never will: why can I not get rid of this? You try to purge a layer, a text style, a linetype or a block, AutoCAD refuses, and nothing on screen appears to be using it. This finds what is, and tells you exactly where.
What WhereUsed does
Every block definition in the drawing, model space and every paper space layout included — they are all block definitions underneath, so one sweep of the block table covers the lot. That catches the usual culprit: a stray object on the layer inside a block nobody has opened for years.
Then the references that are not objects at all, and which are what normally defeats people:
- a LINETYPE assigned to a LAYER definition, even an empty one
- a TEXT STYLE named by a DIMENSION STYLE as its text font
- a BLOCK named by a DIMENSION STYLE as a custom arrowhead
- anything that is the CURRENT layer, style, linetype or dimstyle
None of those show up when you look at the drawing, which is exactly why they are so annoying.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
WHEREUSED. - Choose layer, style, linetype or block, and name the one you cannot purge.
- Read the report.
How it works
A missing DXF group is not a mismatch. The original compared the wanted name against a group read straight off each entity, and neither group 6 nor group 7 is present on most objects — linetype is omitted when it is BYLAYER, and text style only appears on text.
Comparing a string with the resulting nil is a bad argument type, so the search stopped on the first ordinary line it met. Only Layer and Block ever worked; Linetype and Style crashed every time.
It counts rather than stopping at the first match inside each block, so the report says how much of it there is, not just that there is some.
The mline style dictionary is read per run, not computed once at load time into a global — otherwise a drawing opened later in the session is searched against the wrong dictionary.
Progress is reported without backspacing over itself. Printing a block name and then rubbing it out with a character counter leaves the tail of the longest name on screen whenever a shorter one follows.
Notes and limits
- Four kinds of item: layer, text style, linetype, block.
- It looks at table entries too, which is where the hard cases live.
- Nothing is changed — it only reports.
- Run it before
PURGE, not after.
Download and details
| Name | WhereUsed — find what is still using a layer, style, linetype or block |
| Download | WhereUsed.lsp — 12.5 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | WHEREUSED |
| Requires | nothing beyond a CAD platform with AutoLISP. |
| Source size | 12.5 KB, 272 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
- BLOCKPURGE LISP — removing a block and everything that references it
- STRAYHUNT LISP — finding objects that should not be there
- LAYERHARVEST LISP — auditing what layers are actually in use
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program