In paper space there are more than one floating view ports.
Each one has a unique set of VPLAYER freeze/thaw properties.
When a user double-clicks a view port to become active,
how can I determine if a specific layer in that view port is
either VPthawed or VPfrozen?
Actually, I will apply this to command VPMAX, but for now it makes no difference.
(This is a reactor exercise)
Thanks in advance.
Solved! Go to Solution.
You can find the frozen layers in the extended data of the viewport (registered application = "ACAD"), the 1003 group code stands for frozen layer names.
Gile provided somewhat a hint.
For those curious to learn this answer, here is the code:
;get entity name of desired layer and check if it exists [layer 0 is the example] (if (setq a (tblobjname "LAYER" "0")) (progn ;one method to get viewport entity data and create a list of vpfrozen layer entities [DFX 331] (setq b nil) (foreach x (entget (ssname (ssget "X" (list (cons 0 "VIEWPORT")(cons 410 (getvar "CTAB"))(cons 69 (getvar "CVPORT")))) 0)) (if (= (car x) 331) (setq b (cons (cdr x) b)) );if );foreach ;test if desired layer is in entity list (cond ( (not b) (alert "All VPLayers are thawed. ") ) ( (member a b) (alert "VPLayer \"0\" is frozen. ") ) (T (alert "VPLayer \"0\" is thawed. ") ) );cond (setq a nil b nil) );progn (princ "\nLayer \"0\" does not exist. ") );if (princ)