(defun c:hk ()
(setq xy1 (getpoint "请点击矩形左下角:")
kd (getreal "请输入宽度:")
cd (getreal "请输入长度:")
xy2 (polar xy1 0 cd)
xy3 (polar xy2 (angtof "90") kd)
xy4 (polar xy1 (angtof "90") kd)
)
(command "pline" xy1 xy2 xy3 xy4 "c")
(command "line" xy1 xy3 "")
(setq a (entlast))
(command "change" a "" "p" "lt" "x0" "")
(command "line" xy2 xy4 "")
(setq a (entlast))
(command "change" a "" "p" "lt" "x0" "")
)
试一试,是不是这个效果,,