;=================================================; ; ; ; Next.lsp by Michael Bulatovich, Jan. 2003 ; ; www.michaelbulatovich.ca ; ; ; ; A routine to isolate layers to check for ; ; mis-layered entities. Running Next the first ; ; time checks the first layer in the layer ; ; table. Subsequent calls to Next run down ; ; the table one at a time. In between any ; ; number of operations are allowed. ; ; Next calls for a Zoom>Extents and thaws ; ; ALL layers, so beware of long Regens. ; ; ; ;=================================================; (defun C:Next (/ LayerDATA) (setvar "cmdecho" 0) (setq nextsecond t) (if (not nextfirstflag) (progn (setq LayerData (tblnext "layer" T) nextfirstflag t preset (getvar "expert") ) (setq LayerName (cdr (assoc 2 LayerData))) (command "zoom" "e") (command "-layer" "t" "*" "off" "*" "on" LayerName "s" LayerName "") (setq nextsecond nil) (princ) ) ;end progn ) (if nextsecond (progn (tblnext "layer" T) (tblsearch "layer" LayerName t) (setq LayerData (tblnext "layer")) (setq LayerName (cdr (assoc 2 LayerData))) (if LayerData (progn (command "zoom" "e") (command "-layer" "t" "*" "off" "*" "on" LayerName "s" LayerName "" ) ) (progn (setvar "expert" preset) (alert "All layers have been checked - now restoring your system variables. \n\nRunning Next.lsp again will start checking from the top of the layer list." ) (setq nextfirstflag nil LayerName nil preset nil ) ) ;end inner progn ) ;end inner if ) ;end outer progn (princ) ) ;end outer if ) ; end of defun