;===========================================================; ; ; ; MBA-LAYERS.LSP by Michael Bulatovich, ; ; www.michaelbulatovich.ca ; ; ; ; A routine to quickly change layers within a layer ; ; group in my standard protocol. ; ; ; ;===========================================================; (defun c:- (/ prelist prefix suffix laname ans) (setq prelist (list "L-" "1-" "2-" "3-" "4-" "B-" "S-" "R-" "E-") ) (setq prefix (substr (getvar "clayer") 1 2 ) ) (if (not(equal (member prefix prelist) nil)) (progn (initget "XBold BOld MEd Fine XFine Notes Dim Hatch DEmo Area Ext Int Wndr Misc AXes FUrn MECh Str ABove Opt Lines Foot BEyond BLdg SEtback SIte Grades" ) (setq suffix(getkword(strcat "Type layer suffix for " prefix ":"))) (setq laname(strcat prefix suffix)) (if (tblobjname "LAYER" laname) (setvar "clayer" laname) (progn (prompt "\nLayer does not exist. Would you like to create it? : " ) (setq ANS (strcase (getstring))) (if (or (= ANS "") (= ANS "Y") (= ANS "YES")) (if (entmake (list '(0 . "LAYER") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbLayerTableRecord") '(6 . "CONTINUOUS") '(62 . 7) '(70 . 0) (cons 2 laname) ) ) (setvar "clayer" laname) (prompt "\nInvalid Layer name.") ) ) ) ) ;end if ) ;end of progn (princ "\nCurrent layer is not appropriate for this command. Function cancelled." ) ) ;end if ) ; end defun