Hello there,
I recently came across a LISP routine () which looks to do what I need. So I have a dwg set up with sheet names 'Plot-*' and layers set up as 'Plot-*' too. What I want the LISP to do is VP freeze all 'Plot-*' layers, and then thaw the plot number of which the sheet corresponds to. For example on sheet with name Plot-1 I want all 'Plot-*' layers to freeze but Plot-1 to stay thawed.
Code:
(defun c:layfrz (/ _ctab num ss)
(setq _ctab (getvar 'CTAB))
(foreach x (layoutlist)
(setvar 'CTAB x)
(if (setq ss (ssget "_X" (list '(0 . "VIEWPORT") (cons 410 x) (cons -4 "!=") (cons 69 1))))
(progn
(if (not (and (= 0 (getvar "tilemode")) (>= (getvar "cvport") 2)))
(command "_.mspace")
)
(setq num (substr x (+ (vl-string-position (ascii "-") x) 2)))
(command "_.vplayer" "_F" "*|*Plot-*" "_S" ss "" "_T" (strcat "*|*Plot-" num "*") "_S" ss "" "")
(command "_.pspace")
)
)
)
(setvar 'CTAB _ctab)
(command "_.qsave")
(princ)
)
I did try modifying the code from that forum post by replacing Sheet_ with Plot- and (ascii "-") but I kept getting an error return or the tool just wouldn't work. Is there anyone that could help?
Greg