;LASF.LSP V3.0 by Bill DeShawn 9-14-2000 ;USER AGREES THAT THIS PROGRAM WAS OBTAINED ;AT HIS OR HER RISK AND AGREES THAT ;BILL DESHAWN IS NOT RESPONSIBLE FOR ANY NEGATIVE OUTCOME ;AS A RESULT OF USING THIS PROGRAM (defun lasferr (msg) (setvar "snapmode" sn) (setvar "regenmode" rg) (setq *error* olderr) (princ msg) (prompt ". Please try again.") (setq sn nil rg nil n nil a2 nil b2 nil L1 nil L2 nil) (command "_.undo" "_end") (princ) ) (defun c:unlasf (/ rgm mbr) (setq rgm (getvar "regenmode")) (setvar "regenmode" 0) (foreach mbr thawon (command "_layer" "t" mbr "")) (foreach mbr froze (command "_layer" "f" mbr "")) (command "_.regen") (setvar "regenmode" rgm) (princ) ) (defun lasfchk (/ priorthawon priorfroze) (setq priorthawon nil) (setq priorfroze nil) (setq thawon nil) (setq froze nil) (setq lchk (tblnext "LAYER" T)) (setq idx 0) (while lchk (if (= (cdr (assoc 70 lchk))0); if the layer checked is thawed and on... (if (= idx 0) (setq thawon (list (cdr(assoc 2 lchk)))); then start a thawed-layer list and put the name of the layer checked in it. (setq thawon (append priorthawon (list (cdr(assoc 2 lchk)))));or else append to the prior thawed-layer list the name of the layer checked. ) ) (setq lchk (tblnext "LAYER")) (setq priorthawon thawon); thawon is one of two objectives symbol of this subroutine. It is the total amount of "thawed" and "on" layers. (setq idx (1+ idx)) ) (setq idx 0) (while lchk (if (= (cdr (assoc 70 lchk))1); if the layer checked is frozen and on... (if (= idx 0) (setq froze (list (cdr(assoc 2 lchk)))); then start a frozen-layer list and put the name of the layer checked in it. (setq froze (append priorfroze (list (cdr(assoc 2 lchk)))));or else append to the prior thawed-layer list the name of the layer checked. ) ) (setq lchk (tblnext "LAYER")) (setq priorfroze froze); froze is the 2nd of two objectives symbol of this subroutine. It is the total amount of "frozen" layers. (setq idx (1+ idx)) ) (princ) ) (defun c:lasf (/ sn rg n a2 b2 L1 L2) (command "_.undo" "_g") (setq olderr *error* *error* lasferr) (lasfchk) (setq sn (getvar "snapmode")) (setvar "snapmode" 0) (setq rg (getvar "regenmode")) (setvar "regenmode" 0) (graphscr) (prompt "Select entities on layers you want visible. : " ) (terpri) (setq sset (ssget)) (command "_layer" "t" "0" "s" "0" "f" "*" "") (setq n (sslength sset)) (setq index 0) (setq lasflst nil) (setq priorlst nil) (repeat n (setq a2 (ssname sset index)) (setq b2 (entget a2)) (setq L2 (cdr (assoc 8 b2))) (command "layer" "t" L2 "") (setq index (1+ index)) (if (null lasflst) (setq lasflst (list L2)) (setq lasflst (append priorlst (list L2))) ) (setq priorlst lasflst) ) (command "_.layer" "s" (cdr (assoc 8 (entget (ssname sset 0)))) "") (command "_.layer" "f" "0" "") (prompt (strcat "\n"(itoa n) " objects picked. \nLayer named " (getvar "clayer") " is current. ")) (terpri) (setvar "regenmode" rg) (command "regen") (setvar "snapmode" sn) (setq *error* olderr) (command "_.undo" "_end") (PRINC) ) (Prompt "\n LASF.LSP - Loaded.")(princ)