Thanks Se7en. I missed that. Sorry CAB. It's too early in the morning to catch all that.
I have another question related to the same code. I can't think of a good way to get the undo portion working. I'll repost what improvements I've come up with on this code. I'm thinking something recursive to append all the points selected to be able to undo and move the lastpoint to the correct point, but I don't want this to get bogged down or out of hand. Recursive or not, I think append is the direction I want to go, but I'm sure many of you guys have dealt with creating undo functions in this manner, I thought I'd just throw it out at you and see what more I can learn from you.
(defun c:aet (/ ptpnt endpnt lpnt pmpt)
(setq cmde (getvar "cmdecho")
omod (getvar "orthomode")
)
(setvar "cmdecho" 0)
(setvar "orthomode" 0)
(initget "Continue")
(setq stpnt (getpoint "\nSelect start point of arc or [<C>ontinue]: "))
(cond ((or (= stpnt "Continue") (= stpnt nil))
(setq lpnt (getvar "lastpoint"))
)
((or (/= stpnt "Continue") (/= stpnt nil))
(setq endpnt (getpoint stpnt "\nSelect end point of arc: "))
(command ".arc" stpnt "e" endpnt "d" pause)
(setq lpnt endpnt)
)
)
(while
(progn (initget "Undo")
(setq pmpt (getpoint lpnt "\nSelect end point, Undo or [Enter] to exit: "))
)
(cond ((or (/= pmpt nil) (/= pmpt "Undo"))
(command ".arc" "@" "e" pmpt "d" pause)
(setq lpnt pmpt)
)
((= pmpt "Undo")
(command ".erase" "l" "")
)
)
)
(setvar "cmdecho" cmde)
(setvar "orthomode" omod)
(princ)
)
Regardless of the undo portion not working correctly here, I get an error message that doesn't make sense.
Select end point, Undo or [Enter] to exit:
Select end point, Undo or [Enter] to exit: u
Invalid 2D point.
; error: Function cancelled
u should be a valid point with the initget call, but it's acting like it's not. I don't understand what's going on there. I tried or as well.