Hi, I made this Lisp but I need help to fix it, The Lisp is helping us to write Fractional Imperial and draw in metric but if we cancel the command middle of command in going to stay on Architectural units and I couldn't find a way to keep in metric all the time. bu if we are going to finish the command everything is going to be fine. That would be awesome if you guys can help me. I really appreciate it.
(defun C:PGCTRAV (/ point ds ds2 ds3 a d m s dec_deg)
(setvar "cmdecho" 0)
(if (setq POINT (getpoint "\nPick a Start Point:"))
(progn
(command "_line" point)
(while (> (getvar "CMDACTIVE") 0)
(if (and (setq a (getreal "\nBearing in Deg Mins Sec [DD.MMSS] : "))
(setvar "lunits" 4)
(Setq ds (getdist (getvar 'Lastpoint) "\nEnter the Distance: "))
(setvar "lunits" 2)
(setq ds2 (* ds 0.0254))
)
(progn
(setq d (fix a))
(setq m (fix (* 100 (- a d))))
(setq s (* 100 (- (* 100 (- a d)) m)))
(setq dec_deg (+ d (/ m 60.0) (/ s 3600.0)))
(command (strcat "@" (rtos ds2) "<" (angtos (angtof (rtos dec_deg 2 😎 1) 1 8)))
)
(command "")
)
)
)
)
(princ)
)