Jump to content

LISP - Merge color layers


nelsonavirama

Recommended Posts

Hi guys, need your help, I need a lisp to merge similar color layers into a new layer. I use 4 preset layers: grid, columns, walls, and various texts. Prepare the remaining drawing by the different layers with only 4 kinds of colors, but it is very wasteful to merge all those layers.

 

Thank you for your valuable help.

Link to comment
Share on other sites

LAYMRG command?

 

I know the laymerge, but I need something faster. If you already have color layers, I might just be writing the "milispmerge" command and do the work of uniting all layers of similar colors. Is that many, many files every day. Thank you

Link to comment
Share on other sites

in this page i found the nex code:

http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/LayMrg/td-p/3236852

 

;;;

(defun c:MergeTo0 (/ name layers)

 

(vl-load-com)

 

(vlax-for x (vla-get-layers

(cond (*AcadDoc*)

((setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object))))

)

)

(if (not (wcmatch (strcase (setq name (vla-get-name x))) "0,DEFPOINTS,*|*"))

(setq layers (cons name layers))

)

)

 

(cond ((not layers) (alert "Nothing to merge!"))

(T

(vl-cmdf "_.-layer" "_THAW" "0" "_SET" "0" "" "_.-laymrg")

(foreach layer layers (vl-cmdf "_NAME" layer))

(vl-cmdf "" "_NAME" "0" "_YES")

)

)

(princ)

)

 

;;;

 

I want a similar command but grouping the layers to be joined by Color (use 4 colors white, 251, 6, 2, and 4 layers walls, columns, grid and text).

 

Thank you

Link to comment
Share on other sites

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...