Jump to content

Continuous user input until user exits


TemporaryCAD

Recommended Posts

I'm looking to copy the default behavior of the line command, where it continuously prompts user input until escape is pressed.  How would I best go about implementing this in Autolisp?

Link to comment
Share on other sites

You can use it with while function with getpoint function.

(if (setq p1 (getpoint "\nSpecify a point : "))
  (while (setq p2 (getpoint "\nNext point : " p1))
    (entmake (list '(0 . "LINE") (cons 10 p1) (cons 11 p2)))
    (setq p1 p2)
  )
)

 

Edited by Tharwat
codes added
  • Like 1
  • Agree 1
Link to comment
Share on other sites

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...