Mining a Decade of Your Own AutoCAD Drawings: Batch-Harvesting Part Footprints with Headless AutoCAD
- Justin Eckhardt

- 18 hours ago
- 2 min read
This week we ran an experiment on our own back catalog: could we harvest real, fab-proven part footprints out of ten-plus years of panel layout drawings, automatically? The answer was yes - 72 drawings in, over a thousand unique blocks out, and our parts geometry library tripled in two days. Here is what worked and what bit us, because none of it is in any manual.
Your old drawings are a dataset
If your drafters ever named footprint blocks after the catalog part number - and ours did, going back a decade - then every panel layout you ever shipped is a labeled dataset. A block named after a contactor or a servo drive is a drawn, dimensionally-verified footprint for that exact part, proven by the fact that a machine got built from it. Newer drawings keyed parts through attributes on the inserts instead of block names; same harvest, different key.
The gotchas that cost us hours
accoreconsole scripts must end with (quit) or the console idles until your timeout kills it. Structure every script as defun, call, quit.
accoreconsole redirects its real stdout to a temp file when launched from some shells - your princ output just vanishes. Launch it with an explicit stdout redirect and decode the output as UTF-16-LE.
Attribute definitions inside blocks render as literal text in downstream tools and silently inflate the measured bounding box. A terminal block measured half an inch tall came out reading over four inches wide until we stripped ATTDEF entities from the DXF before rendering. A third of our harvested blocks had inflated dimensions from this one cause.
To force a block to black-on-white, edit the DXF directly: set color group 62 to 7 preserving sign (negative means the layer is off - do not clobber that) and drop true-color group 420. Orders of magnitude faster than recoloring shapes one at a time over COM.
Audit the output with dumb rules before trusting it: anything measuring larger than the enclosure it mounts in is a sheet-border artifact, not a part. Then look at a sample with your eyes anyway.
Why bother
Real geometry means panel layouts that reflect what actually fits on the DIN rail, generated instead of redrawn. The harvest pattern generalizes to any shop with a drawing archive and a naming convention - which is most shops, whether they know it or not. This entry came out of our working engineering log; the full pattern library lives in the Saber knowledge base. If you would rather have it built than build it, that is our day job - reach out through the contact form.
Downloads
Free, no signup. The knowledge file is designed to be dropped into an AI assistant's context. No customer information in any of it.


Comments