Kyle,
Why not create a sub-routine to do your changes to your layers and call it with an included list of things to change.
In place of this
Code:
(setq xr6 (strcat xr3 "|L-TEXTS_LEGEND"))
(command "-layer" "c" "2" xr6 "")
(command "-layer" "lt" "Continuous" xr6 "")
(command "-layer" "lw" "Default" xr6 "")
Use something along the lines of this
Code:
(defun correctlayer ( layername color ltype lweight / )
(command "-layer" "c" color layername "lt" ltype layername "lw" lweight layername "")
)
And then call the sub-routine like this
Code:
(correctlayer (list "|L-TEXTS_LEGEND" "2" "Continuous" "Default"))
This could reduce your code to this
Code:
(defun C:X-I96 (/ CORRECTLAYER TX1 XR1 XR2 XR3 XR4 XR5)
(defun CORRECTLAYER (LAYERNAME COLOR LTYPE LWEIGHT /)
(command "-layer" "c" COLOR LAYERNAME "lt" LTYPE LAYERNAME "lw" LWEIGHT LAYERNAME "")
)
(setvar "cmdecho" 0)
(if (setq XR1 (entsel
"nSelect xref to change to IDS standards for a 1/8'' drawing: "
)
)
(progn
(setq XR2 (entget (car XR1)))
(setq TX1 (cdr (assoc 0 XR2)))
(if (= TX1 "INSERT")
(progn
(setq XR3 (cdr (assoc 2 XR2)))
(setq XR4 (tblsearch "block" XR3))
(if (setq XR5 (cdr (assoc 1 XR4)))
(progn
;;(setq xr6 (strcat xr3 "|*"))
(CORRECTLAYER
(list (strcat XR3 "|L-TEXTS_LEGEND") "2" "Continuous" "Default")
)
(CORRECTLAYER
(list (strcat XR3 "|L-equpt_meter") "1" "Dashed" "Default")
)
(CORRECTLAYER
(list (strcat XR3 "|L-TEXTS_NOTES") "3" "Phantom" "Default")
)
)
(prompt (strcat "n" "xr3" " is not an X-Ref."))
)
)
(prompt "nNo External Reference selected")
)
)
)
(setvar "cmdecho" 1)
(princ)
)
If you are going to repeat a series of identical steps, with only changes to variables (such as your changing the layers, colors, etc.), I would recommend you create a sub-routine for those steps. Try breaking down the big routine into smaller steps.
HTH