Steven P Posted June 12, 2020 Posted June 12, 2020 Good morning, My question today is what are the methods for pausing a command to wait for a user input? I can use a pause for each specific input (entering text or a mouse click): (command "line" pause pause "") (makes a single line) Or if there are a lot of inputs, or an unknown number of inputs something like this: (command "line" (while (= 1 (logand 1 (getvar 'CMDACTIVE)))(command pause)) ) (makes many lines all joined together until enter or space is pressed) But is there a way to pause the command for an unknown number of inputs until say space or enter is pressed to resume the rest of the command? By example, and the reason I am asking is that I have 3rd party software that modifies attached TIFFs in AutoCAD. Suppose I want to Cut away some of the image I do something like this Command: Cut Tiff -> Select cut or copy -> select areas in the drawing to cut -> input lower left corner of image -> input upper right corner of image -> save selection to file or buffer Ending step 2 is done with space or enter and this step is where I want the pause. Obviously I cannot know how many selections that the user will make - and so pausing the command until enter is pressed would be handy. Afterwards lower left corner is just the origin, upper right corner is drawing extents, save selection will be to buffer and can be programmed in. So any thoughts? But also to make this a more useful question, are there other methods to pause a command that is called via LISP Thanks in advance. Quote
Tharwat Posted June 12, 2020 Posted June 12, 2020 Would this method help you with what you are after? (if (setq p1 (getpoint "\nSpecify first point :")) (while (setq p2 (getpoint "\nNext point : " p1)) (entmake (list '(0 . "LINE") (cons 10 p1) (cons 11 p2))) (setq p1 p2) ) ) Quote
Steven P Posted June 12, 2020 Author Posted June 12, 2020 Thanks Tharwat, I can see what you are doing there and it works, should be easy to modify to act as a pause in a command where you need to select points, thanks In my case today, the software selects areas of a referenced TIFF to do its stuff (I can't just copy and paste this)... but... and I'll have to experiment, I might be able to do something with your help here - and learn something new along the way 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.