- (defun c:zdx(/ ang p0 p1 p2 p3 p4 p5 p6 sc)
- ;(setq sc (getint "\n请输入出图比例<100>:"))
- ;(if (not sc) (setq sc 100))
- (setq p0 (getpoint "\n请选择第一点:"))
- (setq p1 (getpoint p0 "\n请选择第二点:"))
- (setq sc (/ (distance p0 p1) 27))
- (setq ang (angle p0 p1))
- (setq p2 (polar p0 ang (/ (distance p0 p1) 2)))
- (setq p3 (polar p2 (+ ang (* pi 0.56)) (* 2.25 sc)))
- (setq p4 (polar p2 (+ ang (* pi 1.56)) (* 2.25 sc)))
- (setq p5 (polar p2 (+ ang pi) (* 1.25 sc)))
- (setq p6 (polar p2 ang (* 1.25 sc)))
- (if (< (distance p0 p1) (* 7.0 sc))
- (progn
- (setq p0 (polar p5 (+ ang pi) (* 2.25 sc)))
- (setq p1 (polar p6 ang (* 2.25 sc)))
- )
- (progn
- (setq p0 (polar p0 (+ ang pi) (* 2.25 sc)))
- (setq p1 (polar p1 ang (* 2.25 sc)))
- )
- )
- (setq os (getvar "osmode"))
- (setvar "osmode" 0)
- (command "PLINE" p0 p5 p3 p4 p6 p1"")
- (setvar "osmode" os)
- (princ)
- )
按照选择两点的距离除一个系数得出折断线的比例,适合自己用,再次感谢楼主的分享 |