Originally Posted by
marko_ribar
I can't use pline command, for it doesn't end quietly... Try to continue routine after pline command like (setq e (entlast)) where (entlast) would be that pline...
Look at the code and you'll see that with (command "pline" pt (while...(command pt)) ""), command terminates with :; error: Function cancelled, and then it continues to execute pline command like there aren't "") sign for quiet exit, and after this it doesn't continue to execute next lines in routine...
Code:
(defun c:plsel ()
(setq pt (getpoint "\nPick first point of polyline"))
(setq ptt pt)
(setq q -1)
(command "pline" pt
(while (< q 0)
(progn
(initget 8 "c C Close")
(command (if (equal (setq pt (getpoint pt "\nor type <c,C,Close> to close polyline : ")) "C")(setq pt ptt)(setq pt pt)) )
(if (or (equal pt ptt)(eq pt nil))(setq q 1))
))
"")
(setq el (entlast))
(setq s (ssadd))
(ssadd el s)
(sssetfirst s s)
(princ)
)
Any corrections to given code will be appreciated...
M.R.