- (defun c:rg (/ pt1 w h pt2 pt3)
- (setvar "cmdecho" 0)
- (setq pt1 (getpoint "\n输入矩形任一角点 :"))
- (if (setq pt3 (getcorner pt1 "\n输入另一角点(回车相对坐标) :"))
- (command "rectang" pt1 pt3)
- (progn
- (setq w (getdist "\n输入宽度:"))
- (setq h (getdist "\n输入高度:"))
- (setq pt2 (polar pt1 0 w))
- (setq pt3 (polar pt2 (/ pi 2) h))
- (command "rectang" pt1 pt3)
- ))
- (prin1)
- )
|