johnatkinson Posted April 27, 2018 Share Posted April 27, 2018 hello , i am a complete novice only know some basics i work on drawings with 100's of layers and sometimes 100's of XREF's i would like some help on writing a routine i would like to run a routine called simplelayout and this routine would turn off any layers containing AM_5 for example please please please help me and dont hesitate to ask me questions it is driving me nuts Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted April 27, 2018 Share Posted April 27, 2018 The _-Layer command will accept wildcards in layer names. (command "_.-layer" "_off" "*AM_5*" "") Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 27, 2018 Share Posted April 27, 2018 Hi, Or this if you are not a fan of command calls like me. (defun c:Test (/ l n v e) (while (setq l (tblnext "LAYER" (not l))) (and (wcmatch (setq n (cdr (assoc 2 l))) "*AM_5*") (or (minusp (setq v (cdr (assoc 62 (setq e (entget (tblobjname "LAYER" n))))))) (entmod (append e (list (cons 62 (- v))))) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
johnatkinson Posted April 27, 2018 Author Share Posted April 27, 2018 Thank you so much!!!!!!! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 27, 2018 Share Posted April 27, 2018 You are welcome anytime. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 29, 2018 Share Posted April 29, 2018 Just type -la off *AM_5* why program ? 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.