Jump to content

Freeze currently selected multi objects


Jest

Recommended Posts

I need a lisp routine to freeze currently selected objects on multi different layers at once.
Instead to run LAYFRZ command and pick them one by one, I would like to select them
first (like window selection) and then run single command to freeze them and so theirs layers all at once.
Any Ideas?

Link to comment
Share on other sites

(defun c:Test (/ i s c e y l b k)
  ;; Tharwat - Date: 24.Mar.2021			;;
  ;; Freeze layers of selected objects			;;
  ;; NOTE: excludes if any of the layers is current.	;;
  (and (princ "\nSelect objects to Freeze their layers : ")
       (setq c (getvar 'CLAYER)
             i -1
             s (ssget '((0 . "~VIEWPORT")))
       )
       (while (setq i (1+ i)
                    e (ssname s i)
              )
         (or (member (setq y (cdr (assoc 8 (entget e)))) l)
             (= c y)
             (and (setq l (cons y l)
                        b (entget (tblobjname "LAYER" y))
                        k (assoc 70 b)
                  )
                  (entmod (subst (cons 70 (1+ (cdr k))) k b))
             )
         )
       )
  )
  (princ)
)

 

  • Like 1
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...