@willsunagency/cadguide-dwg-version
v1.0.0
Published
Zero-dependency AutoCAD DWG binary magic bytes inspector and version identification matrix (AC1009 to AC1032), maintained by CADGuide.tools.
Maintainers
Readme
@willsunagency/cadguide-dwg-version
Lightweight, zero-dependency AutoCAD DWG binary header inspector and version identification matrix (AC1009 to AC1032). Maintained by CADGuide.tools Engineering.
🎯 Background & Engineering Context
Native AutoCAD drawing files (.dwg) are binary vector files structured around an internal object-oriented database. Unlike open text formats such as DXF or SVG, DWG files store a strict 6-byte ASCII identification code at the very beginning of the file stream (0x00 through 0x05).
When opening legacy drawings or receiving vendor files that trigger fatal errors or "Drawing file is not valid" warnings, inspecting these first 6 magic bytes allows instant version identification without requiring heavy desktop CAD installations.
For an interactive, client-side web inspector that runs entirely in your browser without uploading proprietary geometry to external servers, explore the CADGuide DWG Version Checker.
📦 Installation
npm install cadguide-dwg-versionOr using Yarn / pnpm:
pnpm add cadguide-dwg-version🚀 Quick Usage
Node.js (Reading from File System)
const fs = require('fs');
const { inspectDwgHeader } = require('cadguide-dwg-version');
// Read first 6 bytes from a native DWG file
const buffer = Buffer.alloc(6);
const fd = fs.openSync('assembly_drawing.dwg', 'r');
fs.readSync(fd, buffer, 0, 6, 0);
fs.closeSync(fd);
const result = inspectDwgHeader(buffer);
console.log(result);
/* Output:
{
isValidDWG: true,
signature: 'AC1032',
metadata: {
release: 'AutoCAD 2018–2026',
year: 2018,
dwgVersion: 'AC1032',
supported: true
},
error: null
}
*/Browser / WebAssembly / Client-Side File API
import { inspectDwgHeader } from 'cadguide-dwg-version';
async function handleFileUpload(file) {
// Read first 6 bytes via ArrayBuffer slice
const slice = await file.slice(0, 6).arrayBuffer();
const inspection = inspectDwgHeader(slice);
if (inspection.isValidDWG) {
console.log(`Detected: ${inspection.metadata.release} (${inspection.signature})`);
} else {
console.error(`Invalid DWG signature: ${inspection.error}`);
}
}📊 Complete AutoCAD DWG Magic Bytes Matrix
| Byte Signature | Marketing Name & Release Version | Year of Introduction | OpenDWG / LibGDX Support |
| :--- | :--- | :--- | :--- |
| AC1032 | AutoCAD 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026 | 2018 | Full Support |
| AC1027 | AutoCAD 2013, 2014, 2015, 2016, 2017 | 2013 | Full Support |
| AC1024 | AutoCAD 2010, 2011, 2012 | 2010 | Full Support |
| AC1021 | AutoCAD 2007, 2008, 2009 | 2007 | Full Support |
| AC1018 | AutoCAD 2004, 2005, 2006 | 2004 | Full Support |
| AC1015 | AutoCAD 2000, 2000i, 2002 | 2000 | Full Support |
| AC1014 | AutoCAD Release 14 (LT97 / LT98) | 1997 | Legacy |
| AC1012 | AutoCAD Release 13 (LT95) | 1994 | Legacy |
| AC1009 | AutoCAD Release 11 / 12 (LT R1 / R2) | 1990 | Legacy |
| AC1006 | AutoCAD Release 10 | 1988 | Obsolete |
| AC1004 | AutoCAD Release 9 | 1987 | Obsolete |
| AC1002 | AutoCAD Release 2.5 | 1986 | Obsolete |
| MC0.0 | AutoCAD Release 1.0 (MicroCAD) | 1982 | Historical |
🛠️ Related Engineering Calculators & Resources
- Interactive DWG Inspector: CADGuide DWG Version Checker
- Neutral Axis Shift & Bend Allowance: Sheet Metal K-Factor Calculator
- Workstation Hardware Optimization: CAD & BIM GPU/CPU Sizing Calculator
- STEP / IGES / IFC Interoperability: CAD Format Compatibility Matrix
- Troubleshooting Knowledgebase: CAD & BIM Engineering Guides
- Engineering Utilities Hub: CADGuide Toolbox Portal
