tive29 Posted March 23, 2017 Share Posted March 23, 2017 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 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 23, 2017 Share Posted March 23, 2017 1 very doable 2&3 searching 1,000,000 entities may take a little while. Quote Link to comment Share on other sites More sharing options...
tive29 Posted March 24, 2017 Author Share Posted March 24, 2017 1 very doable2&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. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 24, 2017 Share Posted March 24, 2017 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) ) Quote Link to comment Share on other sites More sharing options...
tive29 Posted March 24, 2017 Author Share Posted March 24, 2017 (edited) 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 March 24, 2017 by tive29 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 25, 2017 Share Posted March 25, 2017 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))) Quote Link to comment Share on other sites More sharing options...
tive29 Posted March 27, 2017 Author Share Posted March 27, 2017 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))) ) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.