I am hoping that there is someone who can give me a few pointers on the lisp routine below. It is supposed to create one segment of a pline in a metric drawing while allowing the user to enter the length in architectural units. Unfotunately that is right about where it fails. Once the user enters the length in architectural units, the lisp routine crashes and returns a 'bad function' error. Any help that I receive will be greatly appreciated!
(defun C:imppl (/ error Pt1 Pt2 Ang1 Ang2 OrigUnit DistA)
(defun error (msg)
(setvar "lunits" OrigUnit)
(princ msg)
(princ)
)
(setq OrigUnit (getvar "lunits"))
(setvar "lunits" 4)
(setq Pt1 (getpoint "\nPick Start Point:"))
(setq Ang1 (getangle Pt1 "\nEnter or Select Angle:"))
(setq Ang2 (* Ang1 57.2957795))
(setq DistA (getdist Pt1 "\nEnter Distance in Imperial Units:"))
(setvar "lunits" OrigUnit)
(SETQ Pt2 (POLAR Pt1 (Ang2) (* DistA 25.4)))
(Command "pline" Pt1 pt2 "")
(princ)
)