Jump to content

Recommended Posts

Posted

How do you make it so you can type a U for "undo" after a getpoint function so you can pick a different point

Posted

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 :)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...