本帖最后由 llsheng_73 于 2013-10-23 15:58 编辑
- (defun C:fx(/ continu b p1 p2 q1 q2 q3 q4 dis ang)
- (setq continu t)
- (while(null(setq b(getreal"\n输入矩形宽度:"))))
- (while continu
- (setq p1(getpoint"\n点取矩形第一点(放弃退出)"))
- (if p1(progn(setq p2(getpoint p1"\n点取矩形第二点(放弃退出)"))
- (if p2(progn
- (setq dis(distance p1 p2)
- ang(angle p1 p2)
- q1(polar p1(+ ang(/ pi 2))(/ b 2.0))
- q2(polar q1 ang dis)
- q3(polar q2(- ang(/ pi 2))b)
- q4(polar q3(+ pi ang)dis)
- )
- (entmake(list(cons 0 "LWPOLYLINE")(cons 100 "AcDbEntity")(cons 100 "AcDbPolyline")(cons 90 4)(cons 70 129)
- (append (list 10) q1)(append (list 10) q2)(append (list 10) q3)(append (list 10) q4)))
- )
- (setq continu nil)))
- (setq continu nil))
- )
- (princ)
- )
|