

I did not test it in a drawing with Layouts, but only in a plain-and-simple drawing in Model Space. So any resulting drawing extracted from a Layer that has inserted Blocks could have content on Layers other than its own. But I couldn't figure out a way to have Locked Layers be that way in the extracted drawings.īe aware that Blocks will be taken into the drawing for the Layer they are inserted on, not for the Layer(s) of any of the Block-definition contents. The fact that it doesn't care about Off or Frozen Layers is nice in that those Layers will also be in the same state in the drawings that are extracted. But Layerp wasn't doing what I expected, but rather seems to take back the previous Layer situation from outside the routine. But it wouldn't take things on Locked Layers without Unlocking them.Īt first, I tried simply unlocking/thawing/turning on each Layer to work with it, to avoid having to check its status, and then using Layerp afterwards to put it back as it was. I was pleasantly surprised that it would take things on Layers that are Off or Frozen, without needing to turn On or Thaw those Layers. The situation with Locked Layers is more complicated than I had expected. (setq laycont (ssget "_X" (list (cons 8 lay)))) (if (= (logand 4 (cdr (assoc 70 (tblsearch "layer" lay)))) 4) locked (substr (getvar 'dwgname) 1 (- (strlen (getvar 'dwgname)) 4)) (while (setq lay (cdadr (tblnext "layer" (not lay)))) will also be taken, but those Layers will *not* be Locked in *Does* take things on Layers that are Off or Frozen, and they CurrentDrive:\CurrentFilePath\CurrentDrawing_Layer.dwg current drawing, with file names constructed thus: Makes a separate drawing of the contents of each Layer in the (defun C:DPL (/ lay laylist base locked) = Drawings Per Layer

This seems to do that, in limited testing under model-space-only circumstances: I have a drawing with some layer and I need to extract each one and save it as a dwg or dxf file.
