Guide

AutoCAD Auditing : Repairing corrupted drawing files

This guide explains AutoCAD auditing in clear, beginner-friendly steps: what it is, why and when to use it, how to run it, alternatives, common errors and fixes, and practical tips to keep your drawings healthy.


What is auditing?

Auditing in AutoCAD is the process of detecting and repairing errors or corruption inside a drawing file. The built-in AUDIT command scans drawing database structures and attempts to fix inconsistencies such as invalid objects, corrupt records, and reference problems. Its goal is to restore file integrity so the drawing opens, saves, and behaves predictably.

Key related concepts:

  • Corrupted drawing: A DWG that has internal database errors causing crashes, missing entities, display problems, or failed saves.
  • Recovery: Using RECOVER to open and repair a file that won’t open normally.
  • Purge: Using PURGE to remove unused named objects (layers, styles, blocks) that can bloat or complicate drawings.
  • Overkill: The OVERKILL command to remove duplicate or overlapping geometry.

Why use auditing? (Purpose and benefits)

  • Restore file integrity: Fixes database-level errors that cause unstable behavior.
  • Prevent data loss: Repairs can recover objects that would otherwise be lost.
  • Improve performance: Removing corrupted or unnecessary records speeds up open/save and redraw.
  • Stabilize collaboration: Clean drawings reduce issues when using Xrefs or when sharing files with colleagues.
  • Avoid cascading problems: Corruption in Xrefs can spread; auditing helps stop propagation.
Read Also:  AutoCAD Paper Space : Layout environment for arranging views and performing print setups

When to use auditing

Use auditing when you encounter any of the following:

  • AutoCAD reports errors on open (e.g., “drawing file contains errors”).
  • Frequent crashes or freezes when opening or editing a file.
  • Objects fail to display, snap, or behave correctly.
  • Save operations fail or produce unusually large files.
  • Problems appear only when attaching Xrefs or plotting.

As a best practice, run AUDIT when you receive drawings from external sources or if a drawing hasn’t been cleaned for a long time.


How to run AutoCAD auditing — Step-by-step

  1. Save a backup copy first

    • Always create a copy of the DWG before repairing. AutoCAD creates .bak and .sv$ files but keep your own backup.
  2. Open the file in AutoCAD

    • If the file won’t open normally, use RECOVER (see below).
  3. Run the AUDIT command

    • Type AUDIT on the command line and press Enter.
    • AutoCAD asks: “Fix any errors detected?” — type Y for Yes to allow automatic fixes.
    • Wait for the command to finish. A summary will appear listing fixes made.
  4. Save the repaired drawing

    • Use SAVEAS and save to a new filename (e.g., append _repaired) to preserve the original copy for reference.
  5. Check and clean up

    • Run PURGE to remove unused named objects (PURGE → enter → ALLYes).
    • Run OVERKILL on 2D geometry to remove duplicates (select objects → type OVERKILL → accept defaults or adjust).
    • Inspect layers, blocks, and Xrefs visually.
  6. Test normal workflows

    • Open, draw, save, attach Xrefs, and plot to ensure the issue is resolved.

Recovering a drawing that won’t open

  • Use RECOVER:

    • From AutoCAD, type RECOVER, select the DWG. The command attempts to repair and opens the file.
    • If the drawing has Xrefs, use RECOVERALL to attempt recovery on referenced drawings as well.
  • If RECOVER fails:

    • Try opening and saving as DXF: SAVEAS → choose DXF format, then open the DXF and save back as DWG.
    • Use a backup copy: rename .bak to .dwg and open.
    • Use Autodesk’s drawing recovery Manager (AutoCAD displays it on unexpected shutdowns) to recover autosave .sv$ files (rename to .dwg first).
Read Also:  AutoCAD Parametric Constraints : Rules that govern the relationships between geometric objects

Editing results after an audit (how to fix problematic objects)

  • Identify problematic objects:

    • Use QSELECT or Properties palette to find unusual entities or layers.
    • Turn off suspicious layers and isolate objects to test.
  • Remove or replace problematic blocks:

    • Explode corrupted blocks (EXPLODE) and recreate as needed.
    • Redefine blocks by inserting a fresh copy or using BLOCK/WBLOCK to rewrite them.
  • Purge and clean styles:

    • Use PURGE for layers, linetypes, text styles, and dimension styles.
    • If styles are corrupt, recreate them in a clean template and transfer with INSERT or COPYBASE/PASTECLIP.
  • Recreate problematic elements:

    • If a specific object type causes issues (e.g., a heavy Raster image or OLE object), remove and reinsert it.
  • Save to a new file:

    • Use WBLOCK (Write Block) to write the entire drawing to a new DWG file to eliminate hidden corruption.

Alternative methods and related commands

  • -AUDIT (command-line version):

  • RECOVER and RECOVERALL:

    • For drawings that won’t open or have corrupt Xrefs.
  • PURGE:

    • Remove unused named objects and reduce drawing size.
  • OVERKILL:

    • Remove duplicate or overlapping geometry that can cause errors or slow performance.
  • save as DXF:

    • Exports the drawing to DXF and re-imports, which often eliminates obscure DWG corruption.
  • Use a clean template:

    • Create a New drawing from a trusted template and import entities using INSERT or Copy/Paste to transfer content to a clean database.
  • Batch processing:

    • Use scripts or LISP to run -AUDIT, PURGE, and save for many files automatically.

Common errors and fixes

  • Error: “Drawing file contains errors” or “File is not a drawing file”

    • Fix: Run AUDIT or RECOVER. If that fails, try .bak or .sv$ recovery, or DXF export/import.
  • Error: Objects invisible or not selectable

    • Fix: Check layer visibility, freeze/thaw, and use AUDIT then PURGE. Try REGEN to refresh display.
  • Error: Crashes when opening/plotting

    • Fix: Recover file and purge unused content. Check for problematic plot settings or custom plotters; switch to a standard plotter to test.
  • Error: Xref errors after audit

    • Fix: Use RECOVERALL on the host drawing and on each Xref. Reload Xrefs and repair each separately if needed.
  • Error: Large file size after repair

    • Fix: Use PURGEPurge All, OVERKILL to reduce duplicate geometry, and SAVEAS to write a fresh DWG. Consider WBLOCK to export cleaned model.
Read Also:  AutoCAD Tool Palettes : A customizable panel for organizing and accessing tools and content

Tips and best practices

  • Always keep backups: enable autosave and keep .bak copies. Before auditing, save a manual backup copy.
  • Use a trusted template for new drawings to avoid inheriting corrupt styles or objects.
  • Run AUDIT and PURGE periodically on working sets to prevent slow accumulation of unused definitions.
  • Keep AutoCAD updated; some corruption issues are fixed in updates.
  • Before receiving files from external parties, request exports as DXF or ask them to run AUDIT/PURGE.
  • Use RECOVER for files that won’t open and RECOVERALL if Xrefs are involved.
  • For bulk cleanup, script -AUDIT, PURGE, and save operations with AutoCAD scripts or LISP routines.
  • If corruption persists, try opening the DWG in AutoCAD on another machine/version — this can reveal version-specific issues.

How often should I run AUDIT on my drawings?

Run AUDIT whenever you receive files from external sources, after crashes, or periodically for long-term projects (e.g., weekly or monthly depending on project activity).

Will AUDIT always fix a corrupted drawing?

No. AUDIT fixes many database inconsistencies, but severe corruption may require RECOVER, DXF conversion, restoring a backup, or manual reconstruction of content.

Can I automate auditing for many files?

Yes. Use the command-line -AUDIT in a script or LISP routine to run AUDIT and save files in batch. Many firms build automated routines combining -AUDIT, PURGE, and SAVEAS.

Is it safe to answer “Yes” when AUDIT asks to fix errors?

Generally yes, but always work on a backup copy first. Allowing fixes lets AutoCAD attempt repairs that usually preserve more data than not fixing.

What’s the difference between AUDIT and RECOVER?

AUDIT scans and repairs a drawing already opened in AutoCAD. RECOVER attempts to open and repair a drawing that won’t open normally. Use RECOVERALL if Xrefs are involved.

Can AUDIT corrupt a drawing further?

It’s unlikely but possible in rare cases. That’s why the first step should always be save a backup copy. If issues worsen, revert to backup and try alternative recovery methods.

How do I handle corrupted blocks or external references?

Try exploding and recreating blocks, use WBLOCK/INSERT to rebuild blocks in a clean drawing, and run RECOVER on each Xref separately. If Xrefs are corrupt beyond repair, request clean copies from the source.

Will saving as DXF always fix corruption?

Saving as DXF often removes DWG-specific corruption, but it may lose some custom objects, proxies, or object-enabler content. Test carefully and keep originals.