;VPFL - VP Freeze Layer;(discussion forum routine, modified by XANADU);(defun c:VZ ( / ent cLayer pLayer)(setq ent (car(entsel "\nSelect object to VP-freeze layer: ")))(setq cLayer (getvar "clayer"))(setq pLayer (cdr (assoc 8 (entget ent))))(if (= pLayer cLayer) (command "_.layer" "_s" "0" "_off" pLayer "") (command "_.vplayer" "_f" pLayer "_c" ""))(prompt (strcat "Layer " pLayer " frozen in current viewport"))(princ))