Jump to content

Turn on and thaw all layers in drawing...


Recommended Posts

Posted

I'm new to the the forum...and have been searching for about an hour to find a lisp routine that will turn on and thaw all layers in a drawing. My last company had this...all you had to do was press 'A' and all the layers would come up.

 

Thanks in advance.

Posted

As a LISP:

(defun c:a nil (command "_.-layer" "_Thaw" "*" "_ON" "*" "") (princ))

As a Macro (for LT users):

^C^C_.-layer;_Thaw;*;_ON;*;;

Another, LISP:

(defun c:a ( / a b )
   (while (setq a (tblnext "LAYER" (null a)))
       (setq b (entget (tblobjname "LAYER" (cdr (assoc 2 a)))))
       (entmod
           (subst
               (cons 70 (boole 4 1 (cdr (assoc 70 b))))
               (assoc 70 b)
               (subst
                   (cons 62 (abs (cdr (assoc 62 b))))
                   (assoc 62 b)
                   b
               )
           )
       )
   )
   (princ)
)

Another, Visual LISP:

(defun c:a ( / a )
   (vlax-for a (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
       (vla-put-layeron a :vlax-true)
       (if (not (eq (getvar 'CLAYER) (vla-get-name a)))
           (vla-put-freeze a :vlax-false)
       )
   )
   (princ)
)
(vl-load-com) (princ)

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