dxf-drawing-inspection
Skill0 starsChanged 3 months agoMITView on GitHub
Audits DXF and DWG CAD drawings — extracts layers, entity types, bounding boxes, and drawing hygiene issues. Use when reviewing CAD submissions, checking drawing standards compliance, understanding an unfamiliar drawing, or finding orphaned layers and off-origin geometry.
- Installs packages
In this repository7 other files it gives its agents.
- bim-interoperabilitySkill
- building-code-reviewSkill
- egress-life-safetySkill
- ifc-model-analysisSkill
- mep-coordinationSkill
- specification-writingSkill
- sustainable-designSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 67
DWG: not text-readable. Use ezdxf.readfile with the ODA File Converter, or tell the user DWG needs AutoCAD/ODA.
- Distinctive: line 69
Huge files (100MB+): prefer ezdxf; warn before the fallback parser on large files.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
DXF Drawing Inspection
Analyze a CAD drawing and report what's in it: layers, entity inventory, extents, and common hygiene problems. The standard first pass before any CAD task (redlining, cleanup, conversion, quantity counting).
When to use
- "What's in this .dxf/.dwg file?"
- Checking a submission against the office layering standard
- Finding problems before conversion (off-origin, exploded blocks, empty layers)
- Estimating drawing size/complexity
Workflow
Prefer
ezdxffor accurate results:pip install ezdxfimport ezdxf doc = ezdxf.readfile("plan.dxf") msp = doc.modelspace() layers = {l.dxf.name for l in doc.layers} entities = {} for e in msp: entities[e.dxftype()] = entities.get(e.dxftype(), 0) + 1 print(f"Layers ({len(layers)}): {', '.join(sorted(layers))}") print("Entities:", ", ".join(f"{k}: {v}" for k, v in sorted(entities.items())))- Fallback (stdlib only): DXF is a text format. Pair-group lines where even offsets are group codes and odd offsets are values.
0group code = entity start. Seescripts/inspect_dxf.pyfor a complete dependency-free parser. - Report (see output format below).
- Hygiene checks (the valuable part):
- Geometry outside a sane coordinate range (e.g. |x| or |y| > 1e6) — likely off-origin
0layer usage (everything on layer 0 is a red flag)- Empty layers (declared, never used)
- Layers named "Layer1", "aaa", etc. — not renamed
- Duplicate/overlapping entities (e.g. identical LINE entities)
- Missing or non-ASCII drawing units header
Output format
DXF: plan.dxf (AC1027, 4.2 MB)
Layers: A-WALL, A-DOOR, A-GLAZ, A-ANNO, A-DIMS (5)
Entities: LINE 1,204 | TEXT 312 | INSERT 186 | LWPOLYLINE 84 | HATCH 96
Extents: (-125.00, -86.00) to (4,120.00, 3,240.00) [units: mm]
Hygiene: 12 entities at origin (0,0); 3 empty layers (A-AREA, A-FURN); everything on layer 0Edge cases
- Binary DXF: starts with
AutoCAD Binary DXF— requires ezdxf; the stdlib parser should report this clearly. - DWG: not text-readable. Use
ezdxf.readfilewith the ODA File Converter, or tell the user DWG needs AutoCAD/ODA; ask for a DXF export. - AC1009 (R12) and older: ezdxf handles them, but some entity types (HATCH/MTEXT) are newer; expect counts to differ from modern versions.
- Huge files (100MB+): prefer ezdxf; warn before the fallback parser on large files.
- Units: the
$INSUNITSheader variable is often 0 (unitless). Don't guess — report "units: unknown" and let the user confirm.
Files
references/dxf-quick-reference.md— entity types, group codes, and layering conventions.scripts/inspect_dxf.py— dependency-free inspector producing the report above.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

