LAYERSPLIT exports the contents of every layer to its own separate drawing file. You choose an output folder and one DWG is written per layer, named <sourceDrawing>_<layerName>.dwg. Empty layers are reported and skipped.
What LayerSplit does
Typical uses are splitting a combined model out for individual consultants, extracting a single discipline from a merged drawing, or breaking an inherited monster file into something manageable.
The source drawing is not modified. WBLOCK writes copies out; nothing is removed from the drawing you are working in, which is why this routine opens no undo group — there is nothing to undo.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
LAYERSPLIT. - Choose the output folder.
- Read the report — it names the layers it skipped and why.
How it works
Layers that are switched off are skipped, on the basis that they were turned off deliberately and are not wanted in the output. Xref-dependent layers — those with a | in the name — are also skipped, since their content belongs to the referenced drawing rather than to this one.
Filename collisions are handled. If a target filename already exists, a numeric suffix is added — _(1), _(2) and so on — so an existing export is never silently overwritten.
That matters more than it sounds, because running this twice into the same folder is an easy thing to do by accident, and the silent version of that mistake destroys the first export without saying anything.
Notes and limits
- Layers that are off are not exported. Turn them on first if you want them.
- Xref-dependent layers are skipped — their content lives in the referenced drawing.
- Existing files are never overwritten; a numeric suffix is added instead.
- The source drawing is untouched. This copies out, it does not take apart.
Download and details
| Name | LayerSplit — export the contents of every layer to its own drawing file |
| Download | LayerSplit.lsp — 10.7 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | LAYERSPLIT |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com). |
| Source size | 10.7 KB, 272 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
- LAYERHARVEST LISP — audit the layer table before splitting on it
- LAYWRAP LISP — prefix layer names before or after a merge
- DWGPUSH LISP — the opposite direction: push objects into other drawings
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program