There are various ways people will look at the CMDACTIVE System Variable to test whether the Mline
command has not yet been ended, and keep pausing for user input until it is. Here's one:
....
(command "MLINE" "J" "Z" "S" WID)
(while (> (getvar 'cmdactive) 0) (command pause))
(command "EXPLODE" "L" "")
....
You'll see other approaches, such as whether CMDACTIVE is *not equal to* 0 [instead of greater than
0], or Boolean operations to see whether a 1 bit is part of it, or some other things, any of which
do the job.
[And I added the "" in your Explode command to finish the selection.]
--
Kent Cooper
sepult wrote...
I'm trying to create a lisp that draws a mline, than explodes it after the user has picked the
necessary points.
I know it needs to have a while loop similar to Plines but, I'm not sure where and how it goes. can
anyone help?
(defun C:ML ( /LOOP WID)
(if (= (getvar "USERR1") 0)
(progn (C:DW) (C:ML))
(while (not LOOP)
(setq WID (getdist "\nLine Gap: "))
(progn
(setq LOOP 1)
)
(command "MLINE" "J" "Z" "S" WID )
(command "EXPLODE" "L")
)
)
(princ)
tia