The standard PURGE command only removes definitions that are already unused. When a block is still inserted somewhere it simply refuses, and you are left hunting for the last stray reference — which may well be nested three blocks deep on a layout you had forgotten about. BLOCKPURGE does the whole job.
What BlockPurge does
It erases every reference at every level of nesting, across every layout, and then removes the definition. One command instead of a search.
Two ways to choose a block. Pick one in the drawing, or type N for a filtered list of every block defined in the drawing, from which several can be selected at once. The list has a filter box — type part of a name and it narrows.
The routine reports which blocks it removed and which it could not. A block may survive because it is referenced by a dimension style, a multileader style or a table style rather than by any geometry, and being told that is a great deal more useful than being told it failed.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
BLOCKPURGE. - Pick a block in the drawing, or type
Nfor the list. - In the list, type part of a name to filter, and select as many blocks as you want.
- Read the report — it names anything that could not be removed and why.
How it works
Locked layers are handled rather than skipped. References on locked layers would refuse to be deleted, so locked layers are temporarily unlocked, the deletions performed, and the locks restored exactly as they were. Any layer that was not locked is left untouched — the routine restores the state it found, not a state it assumed.
Nesting is followed all the way down. A reference inside a block inside a block is still a reference, and it is the one that keeps PURGE refusing.
There is a documented entry point for batch use. BlockPurge:Delete takes a document object and a list of block names, and can be called from your own scripts. It works with ObjectDBX documents too, so it can process drawings without opening them — which is how you strip a superseded symbol out of a whole project folder.
Notes and limits
- This deletes drawing content. Every reference of the chosen block goes, everywhere. Be sure of the name before confirming.
- Some blocks legitimately cannot be purged. If a dimension, multileader or table style references the block, the definition stays and the report says so.
- Locked layers are unlocked and relocked, so the layer state you had is the layer state you get back.
- One undo group covers the whole operation within a single drawing.
Download and details
| Name | BlockPurge — delete every reference of a block, then purge the definition |
| Download | BlockPurge.lsp — 15.3 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | BLOCKPURGE |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com); nothing extra — the dialog is written to a temporary file at run time and deleted again, so there is no .dcl to install. |
| Source size | 15.3 KB, 380 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| Undo | The whole operation is wrapped in a single undo group, so one U reverses all of it. |
| 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
- BLOCKTALLY LISP — count what is actually in the drawing before purging it
- Delete Layer LISP — the same job for layers
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program