(vl-load-com); if not already loaded

(defun c:rc ()
(initget "Horizontal Vertical")
(setq which
(cond
( (getkword
(strcat
"Line direction [Horizontal/Vertical] : "
); strcat
); getkword
); User-entry condition
(which); User pressed Enter with previous choice -- use it
("Horizontal"); User pressed Enter without previous choice [first use] -- use initial default
); cond
); setq

(command

"_.rectangle" pause pause ; it will ask for the corners

"_.line"

"_none" (vlax-curve-getPointAtParam (entlast) (if (= which "Horizontal") 1.5 0.5))

"_none" (vlax-curve-getPointAtParam (entlast) (if (= which "Horizontal") 3.5 2.5))

"" ; end Line

); command

); defun

(c:rc)

Advertisements