LAYERHARVEST points at a folder, reads every drawing in it, and writes out the complete layer table of each one: name, colour, linetype, lineweight, plot flag, plot style, on, locked, frozen, frozen in new viewports, and description. No drawing is opened in the editor.
What LayerHarvest does
This is the tool for auditing a drawing set against a layer standard. Run it, open the result in Excel, sort by layer name, and every drawing that has strayed shows up immediately — the wrong colour on a dimension layer, a locked layer somebody forgot, a stray layer named Layer1.
The format is chosen by the extension you give the output file. .TXT gives a fixed-width report with columns padded to line up, and the padding character is selectable — spaces for reading on screen, tabs or commas for pasting elsewhere. .CSV opens directly in Excel. .XML can be structured XML, optionally with a stylesheet that makes it a formatted, colour-banded table in a browser, or SpreadsheetML, which Excel opens with one worksheet per drawing.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
LAYERHARVEST. - Choose the folder of drawings.
- Tick the fields you want as columns.
- Give the output file a name, and choose the format by its extension.
How it works
Drawings are read through ObjectDBX, a database-only interface that loads a DWG file’s contents into memory with no editor window, no regeneration and no view to set up. A hundred files are read in the time it takes to open one.
Any drawing already open in this session is read through its live document object instead. Using ObjectDBX on a file that is already open would read the version on disk rather than the one on screen, and silently report stale data — which on an audit is worse than reporting nothing.
Which fields are extracted is a bit field. Each column has its own bit and the check boxes set or clear it. The extraction walks the same ordered list of accessor functions every time and keeps only the ones whose bit is set, so adding a column means adding one accessor and one check box — nothing else changes.
The CSV separator comes from your own Windows regional settings, so it imports cleanly everywhere rather than only where the comma is the list separator.
Notes and limits
- Xref-dependent layers are excluded unless you tick the box. The ones with a vertical bar in their names belong to the referenced drawing, not this one, and would otherwise be reported twice.
- True colours are reported as R,G,B; ACI colours as a plain number.
- All settings persist, including the last folder and the output choices.
- It only reads. No drawing is modified or saved.
Download and details
| Name | LayerHarvest — extract layer data from a whole folder of drawings |
| Download | LayerHarvest.lsp — 54.8 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | LAYERHARVEST |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com); nothing extra — the dialog is written to a temporary file at run time and deleted again, so there is no .dcl to install. |
| Source size | 54.8 KB, 1,267 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| Undo | Not needed — this routine only reads the drawing and changes nothing. |
| Compatibility | AutoCAD (any release with AutoLISP), BricsCAD, ZWCAD, GstarCAD, ProgeCAD and other IntelliCAD-based platforms. AutoCAD LT needs a LISP enabler. No .NET, no ObjectARX, no installer. |
| Author | YZ, August 2026 |
| Licence | Free to use, supplied “as is” with no warranty. |
References
- BORROW LISP — import the correct layers once the audit shows what is missing
- LAYERPILOT LISP — stop drawings straying from the standard in the first place
- AIA and NCS layer format — the standard a set is often being audited against
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program