Jump to content

Recommended Posts

Posted

How to merge all layers into one ?I need to merge all layers into one ,but I don't

know how .Who can help me ?Thanks in advance :)

Posted

I think you can also use the LAYMRG command found in Express Tools.

Posted

Here is a simple lisp that copies all entities to layer zero and optionally deletes the other layers. No warranty.

 

; CLZ.LSP - Collapse all layers to layer 0, i.e., move all entities to layer 0
;           and optionally delete all empty layers.
(defun c:clz (/ en el uchk)
(setvar "CLAYER" "0")
; change layer of each entity to "0"
(setq en (entnext))
(while en
   (setq el (entget en))
   (setq el (subst (cons 8 "0") (assoc 8 el) el))
   (entmod el)
   (setq en (entnext en))
)
; delete all layers except "0" ?
(initget 1 "Yes No")
(setq uchk (getkword "\n Delete all empty layers? (Y)es or (N)o  "))
(if (= uchk "Yes")
 (progn
   (setvar "CMDECHO" 0)
   (command ".purge" "LA" "All")
   (setvar "CMDECHO" 1)
 )
)
(princ)
)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...