求一个方便实用的画CAD双折断线的程序
在画CAD图时,有的图可能尺寸较长或者只画其中的一部分需要画上双折断符号,所以需要一个这样的程序或插件,谢谢。yoyoho 发表于 2013-6-25 08:13
;;; ------------------------------------------------------------------
;;; jdx2 画截断双线
(defun...
个人意见:
(setq ptt (polar pt1 (- ang (/ pi 2)) (* 1 scale)))
改为
(setq ptt (polar pt1 (- ang (/ pi 2)) (* 6 scale)))
比较合适。
(setq scale 50)
比较合适。
村夫 发表于 2013-6-24 11:55
(defun c:zdx (/ osmo cmde orth ang angx dist leng lengx pta ptb lengy p1 p2 p3 p4
p5 ...
全局比例,应该添哪里啊 yoyoho 发表于 2013-6-25 08:13
;;; ------------------------------------------------------------------
;;; jdx2 画截断双线
(defun...
感谢分享优质代码~
能自动折线比例就好了~ zdx(折断线)学院派工具箱 清风明月名字 发表于 2013-6-23 10:22 static/image/common/back.gif
zdx(折断线)学院派工具箱
你好,能给发过来么?857535392@qq.com,非常感谢。 ET里就有这个工具 ET里就有这个工具:breakline 本帖最后由 村夫 于 2013-6-24 11:58 编辑
(defun c:zdx (/ osmo cmde orth ang angx dist leng lengx pta ptb lengy p1 p2 p3 p4
p5 p6 p7 p8 pt1 pt2)
(setq osmo(getvar "osmode")
cmde(getvar "cmdecho")
orth (getvar "orthomode")
)
(while (setq pt1 (getpoint "\n第一点:"))
(setq pt2 (getpoint pt1 "\n第二点:"))
(if (and pt1 pt2)
(progn
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(setvar "orthomode" 0)
(setq ang (angle pt1 pt2)
angx(/ pi 12)
dist (distance pt1 pt2)
leng(+ dist 2.5)
lengx (/ 1.75 (cos angx))
pta (polar pt1 (+ pi ang) 1.25)
ptb (polar pt2 ang 1.25)
lengy (* 1.75 (/ (sin angx) (cos angx)))
)
(if (< dist 40.0)
(progn
(setq p1 (polar (polar pt1 ang (* 0.5 dist))
(+ ang pi)
(* 2 lengy)
)
p2 (polar p1 (- ang (* 5 angx)) lengx)
p3 (polar p2 (+ ang (* 5 angx)) (* 2 lengx))
p4 (polar p3 (- ang (* 5 angx)) lengx)
)
(command "pline" pta p1 p2 p3 p4 ptb "")
)
(progn
(setq p1 (polar (polar pt1 ang (/ dist 3))
(+ ang pi)
(* 2 lengy)
)
p2 (polar p1 (- ang (* 5 angx)) lengx)
p3 (polar p2 (+ ang (* 5 angx)) (* 2 lengx))
p4 (polar p3 (- ang (* 5 angx)) lengx)
p5 (polar (polar pt1 ang (* 2 (/ dist 3)))
(+ ang pi)
(* 2 lengy)
)
p6 (polar p5 (- ang (* 5 angx)) lengx)
p7 (polar p6 (+ ang (* 5 angx)) (* 2 lengx))
p8 (polar p7 (- ang (* 5 angx)) lengx)
)
(command "pline" pta p1 p2 p3 p4 p5 p6 p7 p8 ptb "")
)
)
)
)
(setvar "cmdecho" cmde)
(setvar "osmode" osmo)
(setvar "orthomode" orth)
)
(princ "\n无效或未有选取点!")
(princ)
)
(princ "ZDX") 村夫 发表于 2013-6-24 11:55 static/image/common/back.gif
(defun c:zdx (/ osmo cmde orth ang angx dist leng lengx pta ptb lengy p1 p2 p3 p4
p5 ...
非常感谢,研究一下啦。 ;;; ------------------------------------------------------------------
;;; jdx2 画截断双线
(defun C:jdx2 (/ lay pt1 pt2 dis x1 pt3 pt4 pt5 pt6 ss ptt scale)
(command "osnap" "endp,mid,int,cen") ;;;设定抓端点,中点,交点,圆中心
(setvar "CMDECHO" 0)
(setq lay (getvar "clayer"))
(command "color" "bylayer")
(command "layer" "m" "jdx" "c" "m" "jdx" "")
(setq scale (getreal "\nScale<300>:"))
(if (= scale nil)
(setq scale 300)
)
(setq pt1 (getpoint "\nFirst point:"))
(setq pt2 (getpoint pt1 "\nSecond point:"))
(setq ang (angle pt1 pt2))
(setq dis (distance pt1 pt2))
(setq x1 (/ (- dis (* 2 scale)) 2))
(setq pt3 (polar pt1 ang x1))
(setq pt4 (polar pt1 ang (+ x1 (* 2 scale))))
(setq pt5 (polar pt3 (+ ang 1.32582) (* 2.0616 scale)))
(setq pt6 (polar pt4 (- ang 1.81577) (* 2.0616 scale)))
(setq ptt (polar pt1 (- ang (/ pi 2)) (* 1 scale)))
(setq osd (getvar "osmode"))
(setvar "osmode" 0 )
(command "pline" pt1 "w" "0" "0" pt3 pt5 pt6 pt4 pt2 "")
(setq ss (entlast))
(command "copy" ss "" pt1 ptt)
(command "layer" "s" lay "")
(setvar "osmode" osd)
(princ)
(princ)
) yoyoho 发表于 2013-6-25 08:13 static/image/common/back.gif
;;; ------------------------------------------------------------------
;;; jdx2 画截断双线
(defun...
谢谢好心人
页:
[1]
2