dear all
[Quote]
;;;/////////////////////////////////////////////// ////////////////// (Defun c: SLS (); Define function (Setq ROL (getvar "clayer")); Set ROL to current layer (SET_LAYER); Goto SET_LAYER Function (RESET_ORIGINAL_LAYER); Goto RESET_ORIGINAL_LAYER Function (Princ); Exit quietly ); End of define function ;;;/////////////////////////////////////////////// ////////////////// (Defun SET_LAYER (); Define function (CREATE_LAYER "Const" "1" "CONTINUOUS"); Goto CREATE_Layer Function, Layer Name, Color, LineType (CREATE_LAYER "Steel" "2" "CONTINUOUS"); Goto CREATE_Layer Function, Layer Name, Color, LineType (CREATE_LAYER "Dimension" "4" "CONTINUOUS"); Goto CREATE_Layer Function, Layer Name, Color, LineType (CREATE_LAYER "Hidden" "1" "HIDDEN"); Goto CREATE_Layer Function, Layer Name, Color, LineType (CREATE_LAYER "Text" "7" "CONTINUOUS"); Goto CREATE_Layer Function, Layer Name, Color, LineType (CREATE_LAYER "Welds" "6" "CONTINUOUS"); Goto CREATE_Layer Function, Layer Name, Color, LineType (CREATE_LAYER "Ref" "8" "CONTINUOUS"); Goto CREATE_Layer Function, Layer Name, Color, LineType ); End define function ;;;/////////////////////////////////////////////// ////////////////// (Defun CREATE_LAYER (NLAY CLR LT / LAY FRZ); Define function, Declare variables and arguments (Setq LAY (tblsearch "layer" NLAY)); Search drawing to find layer (If; If the following returns true (Not LAY); Layer not in drawing (Command "_.layer" "m" NLAY "c" CLR "" "lt" LT "" ""); Layer command ~ make new layer with color and linetype (Progn; Then do the following (Setq FRZ (cdr (assoc 70 LAY))); Variable FRZ is frozen layer (If (= FRZ 65); Layer frozen from last edit (Progn; Then do the following (Command "_.layer" "t" NLAY ""); Thaw new layer if frozen (Command "_.layer" "s" NLAY ""); Set new layer ); End progn (otherwise. ..) (Command "_.layer" "s" NLAY ""); Set new layer ); End if ); End progn (otherwise. ..) ); End if ); End define function ;;;/////////////////////////////////////////////// ////////////////// (Defun RESET_ORIGINAL_LAYER (); Define function (Command "_.layer" "s" ROL ""); Layer command ~ Reset original layer ); End define function ;;;/////////////////////////////////////////////// //////////////////
[/ Quote]
|