Mark,
I rewrote it as you recommend, it certainly looks much cleaner. But, just a note, I was getting an error after each circle command..so I removed the """" from both and it now works fine...
(defun rd (/ pt1 pt2 pt3 dia)
;(init)
(setvar "cmdecho" 0)
(setvar "blipmode" 1)
(setvar "menuecho" 0)
(setvar "highlight" 1)
(setvar "osmode" 32)
(setvar "orthomode" 0)
(command "layer" "m" "AR-Lights" "c" "5" "" "lw" ".25" "" "")
(initget 1)
(setq dia (/ (getdist "\nWhat is the diameter of the light?: ") 2))
(while
(setq pt1 (getpoint "\nSelect first point for midpoint location: "))
(setq pt2 (getpoint pt1 "\nSelect opposite corner: ")
pt3 (mapcar (function (lambda (pt1 pt3) (/ (+ pt1 pt3) 2.0)))
pt1
pt2
)
) ;setq
(command "_.circle" pt3 dia)
(command "_.circle" pt3 (- dia 1))
(redraw)
(command "undo" "m")
) ;while
;(reset)
(princ)
) ;defun
(princ)
Daron,
I added the initget at the beginning but I get an error if I add it in the while.