cadking Posted September 16, 2011 Posted September 16, 2011 How do you make it so you can type a U for "undo" after a getpoint function so you can pick a different point Quote
pBe Posted September 17, 2011 Posted September 17, 2011 This might be of interest to you. Pay attention to this line (= 2 code) ;; Keyboard has been pressed Quote
Lee Mac Posted September 17, 2011 Posted September 17, 2011 Two examples: http://www.cadtutor.net/forum/showthread.php?57026-How-to-Undo-command-while-my-routine-is-running&p=386269&viewfull=1#post386269 http://www.cadtutor.net/forum/showthread.php?57026-How-to-Undo-command-while-my-routine-is-running&p=386275&viewfull=1#post386275 Quote
pBe Posted September 18, 2011 Posted September 18, 2011 I wrote this earlier, try as i might i cant find that link you posted Lee. tried to recreate it by memory: (defun c:gpundo (/ pt x Done op po) (setq pt (getpoint "\nStart Point: ")) (setq x (cons pt x)) (while (not Done) (initget "U") (setq pt_ (getpoint pt "\nNext Point [undo]: ")) (cond ((or (null pt_) (null x) ) (setq Done T)) ((and (listp pt_) x) (grdraw pt pt_ 7 1) (setq x (cons pt_ x) pt pt_)) ((= pt_ "U") (redraw) (setq x (vl-remove (car x) x)) (if (> (length x) 1) (progn (setq po (car x)) (foreach p (cdr x) (grdraw po p 7 1) (setq po p)))(setq Done T)) (setq pt (car x))) ((or (null pt_) (null x) ) (setq Done T)) ) ) (princ "\nDo your thing here") (princ) ) Looks like i'm slightly off Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.