dwg-extraction
Installation
SKILL.md
DWG File Extraction
Extract structured construction intelligence from AutoCAD DWG files (including Civil 3D). DWG is a proprietary binary format that requires specialized tooling — this skill handles the full pipeline from raw .dwg to structured project data.
Pipeline Overview
The extraction happens in four stages:
- Compile libredwg — Build the open-source DWG reader from source (cached after first run)
- Convert DWG → DXF — Use the compiled
dwg2dxfbinary to produce a text-based DXF file - Parse DXF entities — Custom Python parser extracts all entity types with full attribute data
- Structure & store — Organize extracted data into plans-spatial.json sections
The reason we compile from source rather than using a package manager is that libredwg is not available as an apt package in most environments, and Python DXF libraries (like ezdxf) often fail on Civil 3D DXF output due to malformed MATERIAL entries from proprietary objects. The manual parser in this skill handles these edge cases gracefully.