Jest Posted March 23, 2021 Posted March 23, 2021 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? Quote
Tharwat Posted March 23, 2021 Posted March 23, 2021 (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) ) 1 Quote
Jest Posted March 24, 2021 Author Posted March 24, 2021 Perfect...exactly what I need. Thank you! Quote
Jest Posted March 26, 2021 Author Posted March 26, 2021 By the way, could you know the answer to my old post? Quote
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.