Yes. This will set the layer to A2Insulation and colour 9, then return it back to the original layer. Includes error checking if you quit out.
;;Routine to draw insulation symbol into roof/ wall sections
;;written by Andrew NIELSEN Melbourne Australia - andysan1@bigpond.com
;; call as <INSUL1>
;;first pick origin of insulation ; second pick end of insulation
;;third pick height of insulation from first pick
;; draws polyline onto layer "A2INSULATION"
;;modified by Alastair Mallett
(defun newerr (NE)
(if (/= NE "Function bombed out ...")
(princ (strcat "\nError: " NE))
)
(command".LAYER""S"CLYR"")
(setvar"OSMODE" OS)
(setvar"ORTHOMODE" OM)
(setvar"CMDECHO" CE)
(setvar"BLIPMODE" BM)
(command".UNDO""end")
(princ)
);dfn
(defun C:INSUL1 (/ SP EP HT OM CE BM DX AN NX NU
AX PX P1 P2 P3 P4 P5 P6 P7 P8 P9 XT SLST)
(command".UNDO""group")
(setq OS (getvar "OSMODE"))(setvar "OSMODE" 1)
(setq OM (getvar "ORTHOMODE"))(setvar "ORTHOMODE" 1)
(setq CE (getvar "CMDECHO"))(setvar "CMDECHO" 0)
(setq BM (getvar "BLIPMODE"))(setvar "BLIPMODE" 0)
(while (= SP nil) (setq SP
(getpoint "\nPick Start Point of Insulation (Ortho is ON; O/S is End): ")))
(while (= EP nil) (setq EP
(getpoint SP "\nPick Ending Point of Insulation: ")))
(setvar "OSMODE" 0)
(while (= HT nil) (setq HT
(getdist SP "\nPick or Enter Height of Insulation: ")))
(setq CLYR (getvar"CLAYER")) (command".LAYER""M""A2INSULATION""C""8""""")
(setq AN (angle SP EP)
DX (distance SP EP)
NX (/ HT 2)
NU (/ DX NX)
NX (/ HT 2)
AX (+ AN (/ PI 2))
PX (polar SP AX HT)
P1 (polar SP AX (/ HT 1.25))
P2 (polar P1 AN (/ HT 20))
P3 (polar P1 AN (/ HT 4))
P4 (polar P2 AN (/ HT 2.5))
P5 (polar SP AX (/ HT 5))
P6 (polar P5 AN (/ HT 5))
P7 (polar P6 AN (/ HT 10))
P8 (polar P5 AN (/ HT 2))
P9 (polar SP AN (/ HT 2))
)
(setq SLST (ssadd))
(repeat (fix NU)
(command ".ARC" "C" P5 SP P6)
(setq SLST (ssadd (entlast) SLST))
(command ".LINE" P6 P2 "" )
(setq SLST (ssadd (entlast) SLST))
(command ".ARC" P2 "C" P3 "A" "-180" )
(setq SLST (ssadd (entlast) SLST))
(command ".LINE" P4 P7 "" )
(setq SLST (ssadd (entlast) SLST))
(command ".ARC" "C" P8 P7 P9)
(setq SLST (ssadd (entlast) SLST))
(setq SP (polar SP AN NX)
P2 (polar P2 AN NX)
P3 (polar P3 AN NX)
P4 (polar P4 AN NX)
P5 (polar P5 AN NX)
P6 (polar P6 AN NX)
P7 (polar P7 AN NX)
P8 (polar P8 AN NX)
P9 (polar P9 AN NX)
)
)
(setq XT (distance SP EP))
(if (>= XT (/ HT 5))
(progn
(command ".ARC" "C" P5 SP P6 )
(setq SLST (ssadd (entlast) SLST))
(command ".LINE" P6 P2 "" )
(setq SLST (ssadd (entlast) SLST))
(command ".ARC" P2 "C" P3 "A" "-75")
(setq SLST (ssadd (entlast) SLST))
)); end if
(command ".PEDIT" "L" "Y" "J" SLST "" "")
(command ".LAYER" "S" CLYR "")
(setvar "OSMODE" OS)
(setvar "ORTHOMODE" OM)
(setvar "CMDECHO" CE)
(setvar "BLIPMODE" BM)
(command".UNDO""end")
(princ)
);end
(princ)