How can you "tell CAD to change to a linetype" if the linetype definition does not exist in the drawing?
Code:
(DEFUN C:SAS()
(setq cancel *error*)
(setq *error* trapUP)
(setq oldlayer (getvar "clayer"))
(setq oldgen (getvar "plinegen"))
(setq oldwid (getvar "plinewid"))
(setvar "plinegen" 1)
(setvar "plinewid" 0.0)
(COMMAND "-LAYER" "MAKE" "UP-SS" "COLOR" "72" "" "Ltype" "U-SS" "" "" "")
(COMMAND "-linetype" "SET" "U-SS" "")
(COMMAND "PLINE" )
(while (> (getvar "CMDACTIVE") 0) (command pause))
(setvar "clayer" oldlayer)
(setvar "plinegen" oldgen)
(setvar "plinewid" oldwid)
(command "-linetype" "set" "Bylayer" "")
(setq *error* temperr)
(princ)
)
I use the "-linetype" command in the lisp to change it to the linetype I want while still keeping it on the right layer. If the linetype definition doesn't exist CAD will stop halfway through the routine because it can't set it to a linetype that doesn't exist. That is what I meant by telling it to change since you can manually input anything you want in that field.
But you are free to choose any file from any location once you get in the command.
Yeah, but who has time for that
I think this is where the confusion might lie. Yeah, I'm aware of the "linetype" command where you can go to any file and load any linetype you want. When I'm testing linetypes I go in there a lot to reload them to see how they turn out. My problem was that you couldn't create a file called "Utility Linetypes.lin", throw it on the server, throw it in the support path, and run the lisp like you see above and have it work since CAD would not, on its own, look for it in that file. Probably could write a lisp to look in that file though, but I never looked into it.