AUTOCAD • FILE MANAGEMENT AND QUALITY CONTROL

Drawing Repair (AUDIT/RECOVER) — Use AUDIT and RECOVER to check and repair drawings (intro)

Diagnose and salvage corrupt DWG files using AutoCAD's built-in integrity tools.

Historical Context & Motivation

Since Autodesk released the first version of AutoCAD in 1982, the DWG file format has served as the de facto standard for two-dimensional and three-dimensional computer-aided design data. As drawings grew in complexity—incorporating external references, custom objects, proxy entities, and third-party plug-in data—the probability of file corruption increased correspondingly. Power failures during save operations, network interruptions on shared drives, and incompatible object enablers all contributed to a class of failures that could render weeks of design work inaccessible. The engineering and architecture industries needed a reliable mechanism to detect and, where possible, repair these inconsistencies without resorting to a complete redraw.

Autodesk responded by embedding diagnostic and recovery utilities directly into the AutoCAD application. Over successive releases, these utilities evolved from simple database consistency checks into sophisticated repair pipelines capable of salvaging drawings that would otherwise refuse to open. Understanding the lineage of these tools is essential for any practitioner who manages CAD files at scale, because the repair strategies available today reflect decades of accumulated knowledge about how DWG databases can fail.

1982
AutoCAD 1.0 Released
Autodesk ships the first version of AutoCAD with the proprietary DWG format. File sizes are small and corruption is relatively rare, but no formal repair tools exist.
1997
AUDIT Command Matures
AutoCAD Release 14 introduces a refined AUDIT command that walks the drawing database, reports errors, and optionally fixes them in place—establishing the pattern used in every subsequent release.
2004
Drawing Recovery Manager
AutoCAD 2004 debuts the Drawing Recovery Manager palette, which automatically detects crash-related backup files (.bak, .sv$) and presents them alongside the original DWG for side-by-side recovery.
2006
RECOVER Command Enhanced
The RECOVER command gains the ability to handle external references via RECOVERALL, automatically repairing nested xrefs in a single pass.
2020+
Cloud-Era Integrity
AutoCAD integrates with Autodesk cloud storage and version control, adding another layer of redundancy. AUDIT and RECOVER remain the front-line tools for local database integrity, now complemented by cloud-based revision history.

The central question that these tools address is deceptively simple: how can a software application verify the internal consistency of a complex binary database and, when inconsistencies are found, correct them without introducing new errors? The AUDIT and RECOVER commands represent two complementary answers to that question, each optimized for a different failure scenario.

Core Principles & Definitions

Before diving into command syntax, it is important to establish the foundational concepts that underpin drawing repair in AutoCAD. A DWG file is not a flat list of geometric primitives; it is a hierarchical object database with symbol tables, dictionaries, block definitions, and entity records linked by internal handles. Corruption occurs when these linkages become inconsistent—when a handle references a non-existent object, when a symbol table entry points to the wrong block record, or when the file's header metadata disagrees with the actual data content. Understanding the nature of these inconsistencies is the first step toward effective repair.

1

Drawing Database Integrity

Every DWG file contains an internal database of objects linked by unique handles (hexadecimal addresses). Integrity means every handle resolves to a valid object and every parent-child relationship is bidirectional.
2

AUDIT — In-Place Verification

The AUDIT command operates on a drawing that is already open. It traverses the database, flags errors, and optionally repairs them. Think of it as a consistency check performed on a live system.
3

RECOVER — Full Reconstruction

The RECOVER command opens a damaged file from disk, rebuilds the database from scratch, and performs an automatic AUDIT. It is the tool of last resort for files that refuse to open normally.
4

Backup Ecosystem

AutoCAD maintains .bak (backup) and .sv$ (autosave) files. The Drawing Recovery Manager aggregates these alongside the primary DWG, giving you multiple recovery points.
5

PURGE & OVERKILL — Preventive Hygiene

Regular use of PURGE (removes unused named objects) and OVERKILL (eliminates duplicate geometry) reduces database bloat and lowers corruption risk.
KEY TAKEAWAY
Think of AUDIT as running fsck on a mounted filesystem: it checks and patches inconsistencies while the system is live. RECOVER is more like booting into a recovery partition and rebuilding the filesystem from raw blocks. Just as you would not run fsck on an unmountable disk, you would not use AUDIT on a file that AutoCAD cannot open—you would reach for RECOVER instead.

Visual Explanation — The Repair Decision Tree

Choosing the right repair strategy depends on the symptom. The following flowchart maps common failure modes to the appropriate AutoCAD command, guiding you from initial symptom through diagnosis to resolution.

The flowchart shows the standard triage path: attempt to open the file first. If the file opens, run AUDIT to detect and repair errors in the live database. If the file cannot be opened at all, jump directly to RECOVER. If AUDIT reports errors it cannot fix, escalate to RECOVER as a full-rebuild strategy.

Notice the asymmetry in the flowchart: AUDIT is a non-destructive inspection that operates on an already-loaded database, whereas RECOVER performs a fresh parse of the on-disk binary, bypassing any in-memory state that might itself be corrupt. This distinction mirrors the difference between checking a running process's heap integrity versus reloading the binary from its executable image—a concept familiar from operating-systems coursework.

How AUDIT and RECOVER Work Internally

While AutoCAD does not expose the full source code of its repair algorithms, the behavior of AUDIT and RECOVER can be understood through the lens of database consistency checking—a topic well-studied in computer science. The DWG file can be modeled as a directed acyclic graph (DAG) of objects, where each node is an entity or table record and each edge is a handle reference. Corruption corresponds to dangling pointers, cyclic references in an ostensibly acyclic structure, or mismatched checksums in the file header.

AUDIT Algorithm (Conceptual Model)

  1. Phase 1 — Header Validation: Verify the DWG version signature, variable counts, and table offsets. Flag mismatches between declared and actual counts.
  2. Phase 2 — Symbol Table Walk: Iterate through layer, linetype, block, dimension style, and text style tables. Confirm each entry's handle resolves correctly and its owner pointer matches the table's handle.
  3. Phase 3 — Entity Traversal: Walk every entity in model space and paper space. Validate geometric data ranges (e.g., coordinates within ±10²⁰), verify layer and linetype references, and check block insert nesting depth.
  4. Phase 4 — Dictionary Check: Inspect named object dictionaries (ACAD_GROUP, ACAD_MLINESTYLE, etc.). Ensure dictionary entries have valid key-value pairings.
  5. Phase 5 — Report and Optional Repair: Output error count to the command line. If the user chose 'Yes' to fix errors, apply corrections such as re-creating missing symbol table entries or deleting orphaned entities.

RECOVER Algorithm (Conceptual Model)

RECOVER operates at a lower level. Rather than traversing the in-memory object graph, it re-reads the binary DWG file from the first byte, parsing each section according to the DWG specification. It reconstructs the object map (a lookup table mapping handles to file offsets), rebuilds symbol tables from the ground up, and then performs the equivalent of a full AUDIT on the reconstructed database. Any object whose binary data cannot be parsed is logged and discarded rather than allowed to corrupt adjacent records. This is conceptually similar to how e2fsck -y in Linux rebuilds an ext4 journal: the tool trusts the raw on-disk data over any cached metadata.

ℹ️ RECOVERALL vs. RECOVER
The RECOVERALL variant extends RECOVER by also processing all nested external references (xrefs). If your drawing references dozens of other DWG files and any of them are corrupt, RECOVERALL will attempt to repair each xref in turn. Use this when the drawing opens but xrefs fail to load correctly.
This diagram depicts the internal binary layout of a DWG file. Red dashed boxes indicate common corruption sites: dangling handle references in entities, orphaned objects with no valid owner, and duplicate dictionary keys. AUDIT walks this structure in memory; RECOVER re-parses it from the raw binary.

Command Syntax & Related Utilities

AutoCAD provides several commands in the drawing repair family. The table below catalogs each command's syntax, when to use it, and what it does under the hood. Mastering these distinctions will allow you to select the minimum-invasive repair for any given failure scenario—a principle analogous to choosing the least-privilege operation in systems security.

AutoCAD drawing repair command reference
CommandSyntaxWhen to UseKey Behavior
AUDITAUDIT → Y/NDrawing opens but displays errors, missing objects, or crashes during editing.Traverses the in-memory database. Prompts whether to fix detected errors. Results appear in the command line / text window.
RECOVERRECOVER → select .dwgDrawing will not open or crashes immediately upon loading.Parses the binary file from scratch, rebuilds the object map and symbol tables, then runs a full AUDIT automatically.
RECOVERALLRECOVERALL → select .dwgDrawing has corrupt external references (xrefs) that fail to resolve.Performs RECOVER on the host drawing and recursively on all nested xrefs.
PURGEPURGE → select items → PurgeDrawing has grown bloated with unused layers, blocks, or styles.Removes unreferenced named objects from symbol tables, reducing file size and lowering corruption risk.
Drawing Recovery ManagerDRAWINGRECOVERYAutoCAD crashed and you need to locate backup and autosave files.Opens a palette listing the original DWG, .bak files, and .sv$ autosave files with timestamps for each recovery point.
💡 SYSTEM VARIABLE: AUDITCTL
Setting AUDITCTL to 1 causes AUDIT to write its findings to an .adt (audit report) file in the same directory as the drawing. This log is invaluable for post-mortem analysis—analogous to enabling verbose logging before running a diagnostic. Default is 0 (no log file).

Worked Example — Repairing a Corrupt Drawing

Consider the following scenario: you receive a DWG file from a colleague. When you open it, AutoCAD displays a "Drawing file is not valid" error and refuses to load. The file is 12 MB—large enough to contain significant work. Your goal is to recover as much data as possible.

Recovering a Corrupt 12 MB DWG File
1
Step 1 — Attempt Normal OpenUse File → Open or type OPEN at the command line and select the DWG file. AutoCAD attempts to parse the file and reports: "Drawing file is not valid." This confirms that the file header or object map is corrupt beyond the normal open routine's tolerance.
Result: File cannot be opened normally. Escalate to RECOVER.
2
Step 2 — Enable Audit LoggingBefore running RECOVER, set the AUDITCTL system variable to 1 so that a detailed report is generated: type AUDITCTL1 → Enter. This ensures you have a log for post-mortem analysis.
Result: AUDITCTL = 1. An .adt file will be generated upon audit.
3
Step 3 — Run RECOVERType RECOVER at the command line and select the corrupt DWG file from the file dialog. AutoCAD re-parses the binary file, rebuilds the object map, reconstructs symbol tables, and runs an automatic AUDIT. Monitor the text window (F2) for output. Typical output: 17 objects audited, 3 errors found, 3 errors fixed.
Result: Drawing opens with 3 errors automatically fixed. Some entities may have been discarded.
4
Step 4 — Run AUDIT ManuallyEven after RECOVER completes, run AUDITY (fix errors) as a second pass. RECOVER's built-in audit catches most issues, but a manual AUDIT may detect residual inconsistencies in dictionary objects or proxy entities that were reconstructed during recovery.
Result: 0 additional errors. Database is now consistent.
5
Step 5 — PURGE, WBLOCK, and SaveRun PURGEAll to remove orphaned named objects. As an additional safeguard, use WBLOCK to write the entire drawing to a new DWG file. This creates a clean file that discards any residual binary artifacts from the corrupt original. Save the result as your new working file.
Result: Clean 9.6 MB DWG file. File size reduction indicates removed debris.

AUDIT vs. RECOVER — Strengths & Limitations

Both AUDIT and RECOVER target the same goal—database integrity—but they approach it from different angles and have different trade-offs. Understanding these trade-offs is critical for selecting the right tool and for knowing when neither tool will suffice.

AUDIT vs. RECOVER comparison
CriterionAUDITRECOVER
PrerequisiteDrawing must already be open in AutoCAD.Operates on a closed file selected from disk.
ScopeChecks in-memory object graph only.Re-parses entire binary file and rebuilds from scratch.
SpeedFast—seconds on most drawings.Slower—must read and reconstruct the full file.
Repair DepthFixes logical inconsistencies (dangling refs, duplicate keys).Can recover from structural corruption (damaged headers, bad object map).
Data Loss RiskMinimal—only orphaned or invalid objects are removed.Moderate—unparseable objects are silently discarded.
Xref HandlingDoes not repair external references.RECOVERALL extends repair to nested xrefs.
When It FailsCannot fix corruption that prevented the file from opening.Cannot help if the file is truncated or encrypted/zero-filled.
KEY TAKEAWAY
AUDIT and RECOVER are not competing tools—they form a repair escalation ladder. Start with AUDIT (low cost, low risk); if it cannot resolve the issue or the file will not open, escalate to RECOVER (higher cost, deeper repair). If RECOVER also fails, your last resort is inserting the drawing as a block into a fresh file via INSERT. This layered approach mirrors the general engineering principle of applying minimum-force interventions first.

Connection to Advanced File Management

AUDIT and RECOVER are entry-level repair tools, but they exist within a broader ecosystem of file management and quality control practices. Understanding how these introductory commands connect to advanced strategies will prepare you for enterprise-scale CAD administration, where thousands of drawings must be maintained across multi-year projects.

Introductory vs. advanced file management strategies
Introductory Tool / PracticeAdvanced CounterpartKey Difference
AUDIT (manual)Batch AUDIT via scripting (.scr files or AutoLISP)Automated across hundreds of files; results logged to CSV for analysis.
RECOVER (interactive)ObjectARX / .NET API-based recovery with custom error handlersProgrammatic access to the drawing database allows targeted repair of specific object types.
.bak / .sv$ backupsVersion control systems (Vault, Git-LFS, BIM 360)Full revision history with branching, diffing, and role-based access control.
PURGE (manual)CAD standards checking (STANDARDS / CHECKSTANDARDS)Enforces organizational naming conventions, layer schemas, and linetype conformance across all drawings.

If you are coming from a computer science background, think of AUDIT and RECOVER as the manual debugging tools in a toolchain that also includes automated CI/CD-style pipelines. Just as a developer might start with gdb before investing in a full test suite, a CAD administrator starts with AUDIT before building batch scripts that enforce drawing quality across an entire project. The advanced techniques—AutoLISP scripting, .NET plug-in development, and integration with Autodesk Vault—are covered in subsequent lessons on CAD automation and enterprise workflows.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain the fundamental difference between the AUDIT and RECOVER commands in terms of how they access the drawing data. Why does this difference matter when choosing which command to use?
PROBLEM 2BASIC CALCULATION
A drawing contains 5,200 objects. After running AUDIT with the fix option enabled, the command line reports '5,200 objects audited, 14 errors found, 14 errors fixed.' Calculate the error rate as a percentage. If you run AUDIT again immediately after, how many errors would you expect to find, and why?
PROBLEM 3INTERMEDIATE
You open a drawing and notice that certain blocks appear as proxy objects (displayed as boxes with diagonal lines). Running AUDIT reports 0 errors. What is likely happening, and what steps would you take beyond AUDIT and RECOVER to resolve this?
PROBLEM 4APPLIED
You are a CAD manager responsible for 1,200 DWG files on a shared network drive. A power outage corrupts several files, but you don't know which ones. Describe a strategy using AUDIT, scripting, and the AUDITCTL system variable to identify and repair all affected files efficiently.
PROBLEM 5CRITICAL THINKING
RECOVER discards objects it cannot parse. Discuss the implications of this behavior from a data integrity perspective. Under what circumstances might RECOVER make the situation worse? Propose a protocol that minimizes the risk of irrecoverable data loss during the repair process.

Lesson Summary

AutoCAD's AUDIT command performs an in-memory consistency check on an open drawing, traversing the DWG object database to detect and optionally fix errors such as dangling handle references, orphaned entities, and duplicate dictionary keys. When a file cannot be opened at all, the RECOVER command re-parses the raw binary DWG file from disk, rebuilds the object map and symbol tables, and runs an automatic audit. The RECOVERALL variant extends this process to all nested external references.

Effective repair follows an escalation ladder: attempt a normal open first, then AUDIT, then RECOVER, and finally the INSERT-as-block fallback. Enable AUDITCTL = 1 to generate .adt log files for post-mortem analysis. Complement repairs with PURGE and WBLOCK to produce a clean output file. Always work on a copy of the original, and remember that RECOVER may discard unparseable objects—treat it as a lossy transformation and maintain backups accordingly.

Varsity Tutors • AutoCAD • Drawing Repair (AUDIT/RECOVER)