I went through all setvars in the drawings and I cant figure out what is causing my lisp routine to fail.
It runs fine in Versions 2004-2007, just these specific drawings make my lisps fail and I am baffled?
Normally the routine asks for the label i want to type then just places that text on the object i specify and trims the object around it.
Routine:
(defun textinline (txt / entt txt ent pkpt entinf enttyp rot txtnam)
(SETUP)
(lrs "G-ANNO-TEXT")
(SETVAR "OSMODE" 0)
(setvar "texteval" 1)
(if (= nil txt)
(setq txt (getstring T "\n(Press 'Esc' to cancel) Enter Label: ")))
(while (setq ent (entsel "\n(Press 'Esc' to cancel) What do you want to label?"))
(setq pkpt (osnap (cadr ent) "nea"))
(setq entt (car ent))
(setq entinf (entget entt))
(setq enttyp (cdr (assoc 0 entinf)))
(cond
((member enttyp '("LINE" "LWPOLYLINE"))
(setq rotpt (osnap pkpt "end"))
)
((member enttyp '("ARC" "CIRCLE"))
(setq rotpt (osnap pkpt "cen"))
)
(T (ALERT "Must Select ARC CIRCLE POLYLINE or LINE"))
)
(setq rot (angle pkpt rotpt))
(if (and (<= rot (* 3 (/ pi 2))) (> rot (/ pi 2)))
(setq rot (+ rot pi))
)
(if (equal rot (* 3 (/ pi 2)) 0.01)
(setq rot (/ pi 2))
)
(command "text" "j" "m" pkpt "" (* rot (/ 180 pi)) txt)
(setq txtnm (entlast))
(cond
((member enttyp '("ARC" "CIRCLE"))
(command "rotate" txtnm "" pkpt 90)
)
(T)
)
(setq ed (entget txtnm))
(setq rot (cdr (assoc 50 (entget txtnm))))
(entmod ed)
(entupd txtnm)
(command "trim" txtnm "" ent "")
)
(END)
(C:textinline)
)
(defun c:textinline()
(textinline nil)
)
Error description:
The command line spits out:
Command: textinline
Command: (Press 'Esc' to cancel) Enter Label: HWC
What do you want to label?Unknown command "HWC". Press F1 for help.
The drawing ends up inserting a numeric value as text with a decimal going out 12 places and trimming the line to fit around the text.
Any suggestions what drawing settings could cause these types of lisp failures?
EDIT: The [ code ] and [ pre ] tag thing