- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have a program that uses 2 functions to isolate layers and unisolate layers after operation is complete.
I'm trying to get this to work with nested layers within xref drawings.
see below...
;;;;;;;;;;;;;;;;;;;;;;;;;;;LAYER ISOLATION AND RETURN DEFUNS;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun DO_LIS (/ l n lst)
(setq *Lays_Status1* nil
*Lays_Status2* nil
l '("~*|A-WALL" "A-WALL" "~*|A-DOOR" "A-DOOR" "~*|A-GLAZ" "A-GLAZ" "~*|A-AREA-SPCE" "A-AREA-SPCE" "~*|A-AREA-SPCE-IDEN" "A-AREA-SPCE-IDEN")
)
(vlax-for x (vla-get-layers
(vla-get-activedocument (vlax-get-acad-object))
)
(if (member (setq n (vla-get-name x)) l)
(progn
(setq *Lays_Status1*
(cons (list n (vla-get-layeron x))
*Lays_Status1*
)
)
(vla-put-layeron x :vlax-true)
)
(progn
(setq *Lays_Status2*
(cons (list n (vla-get-layeron x))
*Lays_Status2*
)
)
(vla-put-layeron x :vlax-false)
)
)
)
(princ)
);END DO_LIS
;; ;;
(defun DO_LUN (/ l n as)
(setq l '("~*|A-WALL" "A-WALL" "~*|A-DOOR" "A-DOOR" "~*|A-GLAZ" "A-GLAZ" "~*|A-AREA-SPCE" "A-AREA-SPCE" "~*|A-AREA-SPCE-IDEN" "A-AREA-SPCE-IDEN"))
(if (and *Lays_Status1* *Lays_Status2*)
(vlax-for x (vla-get-layers
(vla-get-activedocument (vlax-get-acad-object))
)
(cond ((setq as (assoc (setq n (vla-get-name x)) *Lays_Status1*))
(vla-put-layeron x (cadr as))
)
((setq as (assoc (setq n (vla-get-name x)) *Lays_Status2*))
(vla-put-layeron x (cadr as))
)
)
)
)
(setq *Lays_Status1* nil
*Lays_Status2* nil
)
(princ)
);END DO_LUN
What am I missing here?
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;END LAYER ISOLATION AND RETURN DEFUNS;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Solved! Go to Solution.