Here is another version of pclose with the
ability to enter "c" or "space"/"enter" for the
prompt. Also it cleans up the prompts on the command line.
Mike Melichar
;CODING STARTS HERE
;---------------------------------------------------------------------
; draw pline and close with c, enter or space
;---------------------------------------------------------------------
(defun c:pclose (/ pt1 pt2)
(setq cmdecho (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq pt1 (getpoint "\nStart point: "))
(setq pt2 (getpoint pt1 "\nNext point: "))
(command "PLINE" pt1 pt2)
(while pt2
(initget "Close")
(setq pt2 (getpoint pt2 "\nNext point or [Close/Enter]: "))
(if (or (= pt2 "Close") (= pt2 nil))
(progn
(command "c")
(setq pt2 nil)
)
(command pt2)
)
)
(setvar "cmdecho" cmdecho)
(princ)
)
;CODING ENDS HERE
|