0 Members and 2 Guests are viewing this topic.
Here's my rinky dink version:Use NLAYUNISO to restore layer settings.Code: [Select](defun dxf (x ename / llst) (cdr (assoc x (entget ename))))(defun c:nlayiso (/ LAYS LLST X) (setq lays (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)) ) ) (if *frzlyrs* (c:nlayuniso) ) (while (setq x (nentsel "\nSelect objects to isolate nested layers: ")) (progn (setq llst (cons (dxf 8 (car x)) llst)) (if (nth 3 x) (foreach z (nth 3 x) (setq llst (cons (dxf 8 z) llst)) ) ) ) ) (if llst (progn (vlax-map-collection lays '(lambda (x) (if (not (member (vla-get-name x) llst)) (progn (setq *frzlyrs* (append *frzlyrs* (list (cons x (vla-get-freeze x)))) ) (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-freeze (list x :vlax-true) ) ) ) ) ) ) (defun c:nlayuniso (/) (if *frzlyrs* (mapcar '(lambda (x) (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-freeze (list (car x) (cdr x)) ) ) ) *frzlyrs* ) ) (command "._regen") (setq *frzlyrs* nil) (princ) ) ) ) (princ))
(defun dxf (x ename / llst) (cdr (assoc x (entget ename))))(defun c:nlayiso (/ LAYS LLST X) (setq lays (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)) ) ) (if *frzlyrs* (c:nlayuniso) ) (while (setq x (nentsel "\nSelect objects to isolate nested layers: ")) (progn (setq llst (cons (dxf 8 (car x)) llst)) (if (nth 3 x) (foreach z (nth 3 x) (setq llst (cons (dxf 8 z) llst)) ) ) ) ) (if llst (progn (vlax-map-collection lays '(lambda (x) (if (not (member (vla-get-name x) llst)) (progn (setq *frzlyrs* (append *frzlyrs* (list (cons x (vla-get-freeze x)))) ) (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-freeze (list x :vlax-true) ) ) ) ) ) ) (defun c:nlayuniso (/) (if *frzlyrs* (mapcar '(lambda (x) (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-freeze (list (car x) (cdr x)) ) ) ) *frzlyrs* ) ) (command "._regen") (setq *frzlyrs* nil) (princ) ) ) ) (princ))
Quote from: ronjonp on October 31, 2007, 05:17:45 PMQuote from: Bob Wahr on October 31, 2007, 05:04:34 PMLAYOFF and LAYFRZThat does the opposite of what he wants.Misread the second half of his sentence.
Quote from: Bob Wahr on October 31, 2007, 05:04:34 PMLAYOFF and LAYFRZThat does the opposite of what he wants.
LAYOFF and LAYFRZ