If you’re looking for a complete, beginner-friendly guide to purging in AutoCAD — what it is, why and when to use it, step-by-step instructions, alternative methods, common errors and fixes, plus practical tips — this guide covers everything you need.
What is purging in AutoCAD?
Purging is the process of removing unused named objects and definitions from a drawing to reduce file size, simplify the drawing database, and improve performance. Items that can be purged include unused blocks, layers, linetypes, text styles, dimension styles, multileader styles, and registered application IDs (regapps).
Purging does not remove actual geometry that is referenced in the drawing. It removes the definitions that are not referenced by any visible objects.
Why purge? Benefits and use cases
- Reduce file size: Removing unused definitions often reduces DWG file size.
- Improve performance: Fewer named objects speeds up saving, opening, and regenerating.
- Clean shared drawings: When collaborating across teams, purging removes leftover styles and blocks added by others.
- Avoid errors and clutter: Keeps the Name Manager organized (Blocks, Layers, etc.) and helps prevent accidentally using obsolete styles.
- Prepare for archiving or delivery: A purged file is easier to hand off or store.
Common use cases:
- Before handing off files to clients or contractors.
- After importing or attaching Xrefs from other sources.
- Regular housekeeping for large project drawings.
When and how often to purge
- Before final delivery of a drawing or whenever you need to minimize file size.
- After importing content (blocks, layers, styles) or attaching external references.
- Periodically during a project (weekly or at milestones), especially for large projects.
- Before running CAD standards checks or batch processing.
How to purge — step-by-step (basic and advanced)
Method A — Using the PURGE dialog (graphic method)
- Type PURGE and press Enter (or: Manage tab > Cleanup panel > Purge).
- The Purge dialog opens. It lists categories like Blocks, Layers, Linetypes, etc.
- Expand a category to see unused items. Select the items you want to remove or click Purge All to remove all unused items in all categories.
- Optionally check Purge nested items (if available) to remove definitions that are unused but nested inside other definitions.
- Click Purge (or Purge All) and then OK to confirm.
Method B — Using the command-line version (-PURGE) (for scripting or advanced control)
- Type -PURGE (note the leading dash) and press Enter.
- Follow prompts. You can choose All to purge all unused categories, or Regapps to remove registered application IDs only.
- Confirm each prompt or use the command-line options to automate in scripts.
Use -PURGE in scripts or .SCR files to automate purging across multiple drawings.
Method C — Purge regapps (registered application IDs)
- Type -PURGE and press Enter.
- At the prompt, choose Regapps.
- Confirm to remove all unused regapps. This often reduces file size when third-party apps have registered custom data.
Method D — Purge via Ribbon and tools
- Manage tab > Cleanup panel > Purge shows the same dialog with options such as Purge All and Purge nested items.
- For Express Tools or plugins, use their cleanup utilities if available.
Alternative cleaning methods (when PURGE is not enough)
WBLOCK (Write Block) to a new file:
- Use WBLOCK to write selected objects or the entire drawing to a new DWG. This writes only the named definitions actually referenced, often producing a much smaller, cleaner file.
- Steps: Type WBLOCK, choose Entire Drawing or Objects, save to a new file, then open the new file.
SAVEAS:
- Sometimes saving as a different DWG version can reduce size, but results vary. Combine with PURGE/WBLOCK for best effect.
OVERKILL:
- Type OVERKILL (Express Tools / Modify > Overkill) to remove duplicate geometry and simplify polylines. This complements purging by cleaning geometry rather than named definitions.
LAYDEL (use with caution):
- Type LAYDEL to Delete layers even if they contain objects (deletes the objects on those layers). Useful if layers are stubbornly retained because of hidden references. Use backups first.
AUDIT and RECOVER:
- Run AUDIT to fix drawing errors; use RECOVER if drawing is corrupted. Cleaning errors first may allow purge to succeed.
Common errors, why purge may fail, and fixes
Problem: Item cannot be purged — it is in use.
- Fix: Check references. The item might be used by a block, xref, viewport, or hidden object. Use SELECT to find references or open the block editor to inspect block contents. Explode or edit blocks to remove references if safe.
Problem: Layer won’t purge because it appears “in use.”
- Fix: Make sure the layer is not current, not referenced by viewport or layout, and not assigned to objects or block contents. Use LAYDEL to force-delete if you are certain.
Problem: Registered applications (regapps) remain or reappear.
- Fix: Use -PURGE and choose Regapps. If they reappear, an attached xref or a third-party app may be re-registering them — detach or purge that source.
Problem: Purge removes definitions but file size remains large.
- Fix: Use WBLOCK to create a new file with only used objects. Also run OVERKILL, AUDIT, then save. Sometimes the drawing database has residual data that only WBLOCK clears.
Problem: Cannot purge anonymous or dependent blocks.
- Fix: Identify anonymous blocks (names starting with *). Use PURGE dialog with Purge nested items, or manually remove the objects referencing them or redefine them.
Problem: Xrefs prevent purging of their named objects.
- Fix: Detach the xref or open the xref drawing and purge that file separately.
Always keep a backup before aggressive operations (LAYDEL, WBLOCK, or deleting items).
Tips & best practices
- Always save a backup before purging or running destructive commands.
- Run AUDIT first to correct drawing errors that may prevent purging.
- Use Purge All and check Purge nested items for a thorough clean.
- For batch cleaning, create a script that runs -PURGE and AUDIT and executes a SAVEAS.
- Use WBLOCK to produce the cleanest new file if PURGE does not reduce size enough.
- If collaborating, agree on a CAD standard to avoid accumulating unnecessary definitions.
- Regularly purge drawings as part of project housekeeping (e.g., weekly).
- To reduce recurring regapps, uninstall or disable third-party apps that register unnecessary data.
Edit / control purge behavior
- The Purge dialog gives manual control to choose which categories to purge.
- Use -PURGE in scripts for non-interactive control; include Regapps option when needed.
- Use Options > Files and system variables only if you need advanced behavior (most users won’t need to change system variables for purging).
- For repetitive tasks, consider writing a simple AutoLISP routine or script that runs -PURGE, OVERKILL, AUDIT, SAVEAS/WBLOCK in sequence.
FAQ
How does PURGE affect attached Xrefs?
Purge only affects the current drawing. Attached Xrefs are external files; to purge their unused definitions, open and purge each Xref or detach the Xref before purging the host drawing. Purge will not remove definitions that are referenced by xrefs.
Will PURGE remove unused layers that are hidden in viewports?
Not always. If a layer is referenced by an object in a layout viewport or used indirectly inside a block or annotation, it will be considered “in use.” Check viewports and block contents; if necessary, use LAYDEL after ensuring it’s safe.
What are regapps and why should I remove them?
Regapps are registered application IDs created by third-party add-ons. They can bloat files if unused. Use -PURGE and choose Regapps to safely remove unused regapps. Be cautious: if a third-party app is still in use, it may re-register them.
Can I automate purging for many drawings at once?
Yes — use scripts (.scr) containing -PURGE, AUDIT, and WBLOCK/SAVEAS, or create a batch process with AutoLISP or an external script to open each drawing and run the commands. Test on a copy first.
Does PURGE remove duplicate geometry?
No. PURGE removes unused named definitions, not duplicate geometry. Use OVERKILL to remove duplicate or overlapping entities.
Is WBLOCK safer than PURGE for cleaning a file?
WBLOCK often produces a cleaner file because it writes only objects that are explicitly selected, dropping orphaned database entries. Use WBLOCK when PURGE doesn’t sufficiently reduce file size.
Why did file size not change after purging?
Possible reasons: unresolved corruption (run AUDIT), lingering regapps re-registering, or large embedded entities (images, OLE objects, or proxies). Try WBLOCK, detach or clean references, and check for proxies or raster images.
Can PURGE delete required annotation styles?
If a style is unused (no text or dimensions reference it) purge will remove it. Be careful: sometimes styles are expected to be present even if not currently used. Keep a template (.dwt) with standard styles to avoid accidental removal.
End of guide.
