(defun c:pbox() ;以下数字需要输入 (setq pa (getpoint "输入左下角点:")) (setq ww (getreal "宽度:")) (setq hh (getreal "高度:")) ;以下又程序计算得出 (setq pb (polar pa 0 ww)) (setq pc (polar pb (/ pi 2) hh)) (setq pd (polar pc pi ww))
;以下数字需要输入
(setq pa (getpoint "输入左下角点:"))
(setq ww (getreal "宽度:"))
(setq hh (getreal "高度:"))
;以下又程序计算得出
(setq pb (polar pa 0 ww))
(setq pc (polar pb (/ pi 2) hh))
(setq pd (polar pc pi ww))
;以下依据PA等画矩形
(command "pline" pa pb pc pd "c")
;以下MP1等有程序依据 pa,ww,hh
(setq mp1 (polar pa 0 (/ ww 2)))
(setq mp2 (polar pb (/ p1 2) (/ hh 2)))
(setq mp3 (polar pd 0 (/ ww 2)))
(setq mp4 (polar pa (/pi 2) (/ hh 2)))
(command "line" mp1 mp3 "")
(command "line" mp2 mp4 "")
)