01 / 21

The AutoCAD
PURGE Command

Learn how to remove unused definitions like layers, blocks, and linetypes to keep your drawings clean, small, and efficient.

AutoCAD

What Is PURGE?

Every AutoCAD drawing stores named object definitions: layers, blocks, dimension styles, text styles, linetypes, and more. Over time, many of these definitions become unused: no geometry references them, yet they remain in the file.

The PURGE command scans your drawing's definition tables, identifies entries that have zero references, and lets you delete them safely.

Why Unused Definitions Accumulate

Copy / Paste
Pasting objects from other drawings imports their layers, blocks, and styles: even ones you never use again.
XREF Binding
Binding an external reference converts its layers and blocks into local definitions, many of which become orphans.
Template Bloat
Starting from a rich template adds dozens of pre-made styles and blocks you may never place on paper.

What Can Be Purged?

PURGE Layers Blocks Linetypes Dim Styles Text Styles + More

PURGE can clean layers, blocks, linetypes, dimension styles, text styles, table styles, multileader styles, materials, visual styles, and registered applications: essentially any named definition with zero references.

How PURGE Decides What to Remove

1. SCAN Definition tables 2. COUNT References = 0? 3. LIST Purgeable items 4. DELETE Internal PURGE Pipeline

Dialog vs. Command Line

PURGE (Dialog) -PURGE (Command Line)
Invocation Type PURGE Type -PURGE (with hyphen)
Interface Visual tree with checkboxes Text prompts only
Selective? Pick individual items By category or all
Best For First-time users, review Scripts, batch processing
Preview Shows block thumbnail No preview

PURGE vs. DELETE vs. ERASE

PURGE
Removes unused named definitions (layers, blocks, styles) from the database. Does not touch visible geometry.
DELETE / ERASE
Removes visible objects (lines, circles, text) from the drawing. The definitions they used may still remain.
WBLOCK
Writes selected objects to a new file, automatically excluding unused definitions: an alternative to PURGE.

What Cannot Be Purged

1
Layer 0: the default layer exists in every DWG and can never be removed.
2
Defpoints layer: created automatically by dimensions; protected by AutoCAD.
3
Continuous linetype: the built-in default linetype is always retained.
4
Standard text and dim styles: AutoCAD protects the "Standard" style.
5
Current / active definitions: the current layer, current text style, etc. cannot be purged while active.

How to Apply PURGE: Step by Step

1
Save your drawing first: always have a backup before bulk deletions.
2
Type PURGE in the command line and press Enter.
3
In the dialog, expand the tree to review which items are purgeable.
4
Click "Purge All" to remove everything, or select specific items.
5
Run PURGE again: nested blocks may expose new purgeable items after the first pass.
6
Optionally run AUDIT afterward to repair any remaining database errors.

Example 1: Basic Purge

You receive a drawing with 47 layers, but only 12 contain objects. The remaining 35 are empty.

; Step 1: invoke
Command: PURGE

; Step 2: dialog opens, shows 35 unreferenced layers
✓ Select All → click Purge All

; Result: 35 layers removed

Example 2: Nested Block Cleanup

Pass 1 Block "DESK_ASSY" ✕ Purged (unused) Pass 2 Block "CHAIR" (was nested) ✕ Now purgeable! Why run PURGE multiple times? Nested blocks become orphaned only after their parent block is removed.

Example 3: Command-Line Batch Purge

For scripting or batch processing, use the -PURGE (hyphen) variant. This avoids the dialog entirely.

; Purge all unused items non-interactively
Command: -PURGE
Enter an option [All/Blocks/...]: A
Enter name(s) to purge <*>: *
Verify each name to be purged? [Yes/No] <Y>: N

; All unreferenced definitions are removed.

Anatomy of the PURGE Dialog

Purge ▸ Blocks (7) ▾ Layers (35) □ A-WALL-DEMO □ E-POWER-OLD □ M-HVAC-TEMP ... 32 more ▸ Linetypes (3) ▸ Dim Styles (2) ▸ Text Styles (4) Category tree Purge All Close ☑ Confirm each item ☑ Purge nested items Preview Area

Real-World File Size Impact

0 2 MB 4 MB 6 MB 8 MB Before 7.2 MB After PURGE 3.0 MB + AUDIT 1.6 MB 78% reduction

Common Mistakes

✕ Running Only Once
Nested blocks release child definitions only after the parent is purged. Always run PURGE multiple times until zero items remain.
✕ Purging Referenced Items
Attempting to purge a layer that is the current layer. Switch to Layer 0 first, then purge.
✕ Forgetting XREFs
Externally referenced layers cannot be purged. Detach the XREF first if you want to remove its layers.
✕ Skipping the Backup
PURGE is not undoable after saving. Always save or copy the file before running a bulk purge.

Summary Reference Table

Topic Key Detail
Command PURGE (dialog) or -PURGE (CLI)
What It Removes Layers, blocks, linetypes, styles with 0 references
Protected Items Layer 0, Defpoints, Continuous, Standard style, current items
Run Frequency 2-3 times (nested items) or enable "Purge nested"
Companion Commands AUDIT, WBLOCK, OVERKILL
Scripting -PURGE A * N

Question 1 of 5

What does the PURGE command remove from an AutoCAD drawing?

Question 2 of 5

Which of the following can never be purged?

Question 3 of 5

Why is it recommended to run PURGE multiple times?

Question 4 of 5

How do you invoke the command-line version of PURGE (bypassing the dialog)?

Question 5 of 5

You erased all objects on layer "TEMP-SKETCH." After saving, the layer still appears in the layer list. What should you do?