Jump to content

Help with a Lisp routine turn off layers containing "a phrase or number"


johnatkinson

Recommended Posts

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

Link to comment
Share on other sites

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

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