设置比例试一试??
好像不是比例问题 菜卷鱼 发表于 2018-9-28 15:15
(setq pts (trans pts 1 0))
也许是你差这一句
我那个你能调整一下么,我只需要单条的折断线就行
(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 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)
)
是不是自定义函数搞错了,直接改成command吧 start4444 发表于 2018-9-28 18:04
(defun c:zdx(/ ang p0 p1 p2 p3 p4 p5 p6 sc)
(setq sc (getint "\n请输入出图比例:"))
...
哈哈,谢谢了。解决了 start4444 发表于 2018-9-28 18:04
(defun c:zdx(/ ang p0 p1 p2 p3 p4 p5 p6 sc)
(setq sc (getint "\n请输入出图比例:"))
...
感谢楼主的分享,借用了层主的代码 (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)
)
按照选择两点的距离除一个系数得出折断线的比例,适合自己用,再次感谢楼主的分享
页:
1
[2]