eplisp

AutoCAD PURGE Command: Remove Unused Items from a Drawing

Removes unused definitions such as blocks, layers, styles and linetypes.

Command
PURGE
Aliases
PU
English name
Purge

The AutoCAD PURGE command removes items that are defined in the drawing but not used by any object: block definitions, layers, linetypes, text styles, dimension styles, multiline styles, table styles and more. It clears out clutter brought in by copying from other drawings and reduces file size.

In AutoCAD 2020 and later, PURGE opens a redesigned Purge palette. The Purgeable Items view lists what can be removed, and Find Non-Purgeable Items shows what cannot be removed and why. Zero-length geometry and empty text objects can also be purged.

Some items are always protected: layer 0, Defpoints, the current layer, the Standard text and dimension styles and the Continuous linetype. A block used only inside another unused block is removed only when Purge nested items is on.

How to use it

  1. Save the file, then type PURGE or PU and press Enter.
  2. In Purgeable Items, check the item types you want to remove, or leave them all checked.
  3. Turn on Purge nested items so nested unused items are removed too.
  4. Check Purge zero-length geometry and Purge empty text objects if needed.
  5. Click Purge All or Purge Checked Items, and repeat until nothing is left to purge.

Options

Purgeable Items
Lists unused items that can be removed, grouped by type.
Find Non-Purgeable Items
Shows items that cannot be removed and the reason.
Purge nested items
Also removes items nested inside other unused items.
Confirm each item to be purged
Asks for confirmation before each item is removed.
Purge zero-length geometry / empty text objects
Deletes zero-length lines and arcs and text objects with no content.
-PURGE
Command-line version; can also purge registered applications (Regapps) and is used in scripts.

Notes and tips

  • PURGE only removes unused definitions; it never deletes visible objects.
  • If the file is still large, run -PURGE with the Regapps option, then AUDIT the drawing.
  • For heavy files, writing the entire drawing to a new file with WBLOCK also leaves unused definitions behind.