Jump to content

List layername & entity's layername that is in/or has overridden with magenta colour


tive29

Recommended Posts

part of my job involves checking if any layername & entity is in/or has overridden with magenta colour

Short of eyeballing the whole drawing visually & missing out some obsecure entity, is there a LISP or LISPs that can do it faster :

1) list out the layer name that is in magenta colour

2) list out the layer name of the entity that is override with magenta colour

3) (if possible) a way to isolate or zoom in to those entity that is in magenta colour or entity override with magenta colour

Link to comment
Share on other sites

1 very doable

2&3 searching 1,000,000 entities may take a little while.

 

1 & 2 most crucial to me as it is time consuming looking through many drawings & as for 3, I still can manually isolate those layers, though it will help. But 1 & 2 is what I need most.

Link to comment
Share on other sites

Item 1

 

(defun c:test ( / col ans doc lay)
(setq col (strcat "Color_" (getstring "Enter color number 1-255")))
(setq ans (strcat "Layers with " col))
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for lay (vla-get-Layers doc)
(if (= (vla-get-PlotStyleName lay) Col) 
(setq ans (strcat  ans "\n" (vla-get-name lay)))
)
)
(alert ans)
)

Link to comment
Share on other sites

Thanks BIGAL. The pop up message is good. In addition,can it also list in the command line as well so that I can copy the text.

Edited by tive29
Link to comment
Share on other sites

Change the "ans" line to write to a file the layer names easier than copying the text. Or as per new line below remove (alert ans)

 

(setq ans (strcat  ans "\n" (vla-get-name lay)))

(princ (strcat "\n" (vla-get-name lay)))

Link to comment
Share on other sites

Change the "ans" line to write to a file the layer names easier than copying the text. Or as per new line below remove (alert ans)

 

(setq ans (strcat  ans "\n" (vla-get-name lay)))

(princ (strcat "\n" (vla-get-name lay)))

 

Amend the lines to this 2 but not quite right. what is wrong?

 

(defun c:test ( / col ans doc lay)
(setq col (strcat "Color_" (getstring "Enter color number 1-255")))
(setq ans (strcat "Layers with " col))
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for lay (vla-get-Layers doc)
(if (= (vla-get-PlotStyleName lay) Col) 
(princ (strcat "\n" (vla-get-name lay)))
)
)
)

(defun c:test ( / col ans doc lay)
(setq col (strcat "Color_" (getstring "Enter color number 1-255")))
(setq ans (strcat "Layers with " col))
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for lay (vla-get-Layers doc)
(if (= (vla-get-PlotStyleName lay) Col) 
(setq ans (strcat  ans "\n" (vla-get-name lay)))
)
)
(princ (strcat "\n" (vla-get-name lay)))
)

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