那你看看这个行不行

- (defun c:draw()
- (prompt "三阶轴绘制程序,请输入各参数:")
- (setq l1 (getreal "\n输入第一段长度:"))
- (setq d1 (getreal "\n输入第一段直径:"))
- (setq l2 (getreal "\n输入第二段长度:"))
- (setq d2 (getreal "\n输入第二段直径:"))
- (setq l3 (getreal "\n输入第三段长度:"))
- (setq d3 (getreal "\n输入第三段直径:"))
- (setq pt (getpoint "\n输入起点:"))
- (command "_.rectangle" pt (list (+ (car pt) l1) (+ (cadr pt) d1)))
- ;(command "_.pline" (polar pt 0 l1) pt (polar pt (/ pi 2) d1) (list (+ (car pt) l1) (+ (cadr pt) d1)) "")
- (setq pt2 (list (+ (car pt) l1) (- (cadr pt) (/ (- d2 d1) 2))))
- (command "_.rectangle" pt2 (list (+ (car pt2) l2) (+ (cadr pt2) d2)))
- (setq pt3 (list (+ (car pt2) l2) (- (cadr pt2) (/ (- d3 d2) 2))))
- (command "_.rectangle" pt3 (list (+ (car pt3) l3) (+ (cadr pt3) d3)))
- (princ)
- )
|