• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

LAYERSPLIT LISP: Export Every Layer to Its Own Drawing

August 3, 2026

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

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type LAYERSPLIT.
  3. Choose the output folder.
  4. 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

NameLayerSplit — export the contents of every layer to its own drawing file
DownloadLayerSplit.lsp — 10.7 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandLAYERSPLIT
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size10.7 KB, 272 lines
Error handlingYes — a *error* handler restores every system variable it changed, on cancel as well as on error.
UndoNot needed — this routine only reads the drawing and changes nothing.
CompatibilityAutoCAD (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.
AuthorYZ, August 2026
LicenceFree 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

Filed Under: AutoLISP Routines

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (30)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (29)
  • AutoCAD Tutorials (54)
  • AutoLISP Routines (328)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (84)
  • Electrical Drafting (2)
  • General IT reference (7)
  • Geometry (15)
  • GIS (2)
  • Hatch Patterns (12)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (14)
  • Structural Drafting (26)
  • Technical Dictionary (61)
  • Useful Website Links (19)

Footer

Free downloads

  • Free AutoLISP routines
  • Free hatch patterns
  • SHX fonts & text styles
  • Numbering LISP collection
  • ISO 3098B font

Reference charts

  • AWS weld symbols chart
  • Steel detailing chart
  • Hole & slot sizes
  • Bolt edge distance
  • ANSI & ARCH paper sizes
  • How to fold an A1 drawing

Useful links

  • CAD blocks (DWG)
  • Revit families
  • structuraldrafter.com
  • cad-corner.com
  • About
  • Privacy policy

Provided for free with no warranty · Log in