i have been trying to get this line of code to work. if i move the red text between the first and second pause the ortho sets. if i move it between the second and third pause the program crashes. What do i need to do to make this work?
Code:
(defun c:gl ()
(initerr)
(setvar "orthomode" 0)
(command "-style" "notes" "romans.shx" "4.75" ".85" "10" "n" "n" "n")
(setvar "osmode" 512)
(command "-insert" "grabm" pause "" "" pause)
(command "pline" pause pause [COLOR=red](setvar "orthomode" 1)[/color] pause "" "")
(setvar "osmode" 0)
(command "dtext" pause "0")
(reset)
(princ)
)
;;;*==========================================================
(defun initerr ()
(setq oldlayer (getvar "clayer"))
(setq oldsnap (getvar "osmode"))
(setq oldSTYLE (getvar "TEXTSTYLE"))
(setq echo (getvar "cmdecho"))
(setq temperr *error*)
(setq *error* trap)
(princ)
)
;;;*===========================================================
(defun trap (errmsg)
(command nil nil nil)
(if (not
(member errmsg
'("console break" "Function Cancelled"))
)
(princ (strcat "\nError: " errmsg))
)
(setvar "clayer" oldlayer)
(setvar "osmode" oldsnap)
(setvar "textstyle" oldstyle)
(setvar "cmdecho" echo)
(princ "\nError Resetting Enviroment ")
(terpri)
(setq *error* temperr)
(princ)
)
;;;*===========================================================
(defun reset ()
(setvar "clayer" oldlayer)
(setvar "osmode" oldsnap)
(setvar "textstyle" oldstyle)
(setvar "cmdecho" echo)
(princ)
)
;;;*======================================================
(princ)