Tharwat Posted June 12, 2010 Posted June 12, 2010 Hi Everybody, How can I stop running an Autolisp program when user intend to press . For examlpe; (defun c:ib (/ a count) (setq a (cdr(assoc 2 (entget(car(entsel"\nSelect a Block: ")))))) (setq count 1) (while count (command "_insert" a pause "" "" "" )) (princ "Written by Tharwat") (princ)) Regards, Tharwat Quote
David Bethel Posted June 12, 2010 Posted June 12, 2010 Hi Everybody,How can I stop running an Autolisp program when user intend to press Maybe like this: (while (setq ip (getpoint "\nInsert Point - (Enter To Exit): ")) (command "_insert" a ip "" "" "" )) -David Quote
Tharwat Posted June 12, 2010 Author Posted June 12, 2010 Maybe like this: (while (setq ip (getpoint "\nInsert Point - (Enter To Exit): ")) (command "_insert" a ip "" "" "" )) -David Hi Mr.david You said maybe and that was perfect, and what's if you were sure . Thank you so much . Tharwat Quote
David Bethel Posted June 12, 2010 Posted June 12, 2010 Tharwat, The drawback this is scenario is that you are not seeing the block insertion ( dragmode ) Not always necessary but it can be helpful in certain conditions. -David Quote
Tharwat Posted June 12, 2010 Author Posted June 12, 2010 Mr.David, Yes I do agree with you. Tharwat Quote
BIGAL Posted June 15, 2010 Posted June 15, 2010 I use a check for nil in my loops make it your last line in the while (setq x (getint "\n Enter number to exit)) ;1st time pick (while (x nil) ;x is not nil CR pressed etc etc (setq x (getint "\n Enter number to exit)) ; last line before endwhile ( ; endwhile Quote
woolenthreads Posted August 2, 2018 Posted August 2, 2018 All I can say is "Thank You". I've been perusing the web intermittently for a couple of weeks looking for the answer and trying things which failed. I kept running into this one but without a clear understanding of how it worked (or enough understanding of how any of them worked really). It was only a reference in another forum that gave me a clue as to how to apply this answer to my immediate problem. 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.