CAD中怎样合并这两段多线?
发布网友
发布时间:2022-05-05 04:06
我来回答
共5个回答
热心网友
时间:2022-06-29 05:25
如果是CAD2007以上的版本的话,可以使用JOIN命令进行合并。
如果是2004以下的命令,可以使用pedit命令,输入pe也可以,
在输入J ,选择线条,在合并就可以了。
我这里有一个关于合并多段线的2次开发,你可以拿去。保存为TE.lsp
用的时候输入TE就可以了。
(defun c:te()
(command "_ucs" "")
(setvar "osmode" 0)
(setvar "cmdecho" 0)
;(setq point1 (getpoint "please select right-upper point:"))
;(setq point2 (getpoint "please select left-bottom point;"))
;(setq entity (ssget "w" point1 point2))
(setq entity (ssget))
;(setq entity (ssget "w" point1 point2))
(setq i 0)
(repeat (- (sslength entity) 1)
(setq j (1+ i))
(setq entname1 (ssname entity i))
(setq entname2 (ssname entity j))
(setq ent1 (entget entname1) ent2 (entget entname2))
(if (and (or (= (cdr(assoc 0 ent1)) "LINE") (= (cdr (assoc 0 ent1)) "LWPOLYLINE"))
(or (= (cdr(assoc 0 ent2)) "LINE") (= (cdr (assoc 0 ent1)) "LWPOLYLINE"))
)
(progn
(setq pt1 (cdr (assoc 10 ent1))
pt2 (cdr (assoc 11 ent1))
pt3 (cdr (assoc 10 ent2))
pt4 (cdr (assoc 11 ent2))
)
(setq ang1 (/ (* 180 (angle pt1 pt2)) pi)
ang2 (/ (* 180 (angle pt3 pt4)) pi)
)
(if (or (equal ang1 ang2 0.1) (equal ang1 (+ 180 ang2) 0.1) (equal ang2 (+ 180 ang1) 0.1))
(progn
(setq l12 (distance pt1 pt2)
l13 (distance pt1 pt3)
l14 (distance pt1 pt4)
l23 (distance pt2 pt3)
l24 (distance pt2 pt4)
l34 (distance pt3 pt4)
)
(setq l (max l12 l13 l14 l23 l24 l34))
(cond ((= l l12) (setq ptlist (list pt1 pt2)))
((= l l13) (setq ptlist (list pt1 pt3)))
((= l l14) (setq ptlist (list pt1 pt4)))
((= l l23) (setq ptlist (list pt2 pt3)))
((= l l24) (setq ptlist (list pt2 pt4)))
((= l l34) (setq ptlist (list pt3 pt4)))
)
(setq pt5 (polar pt1 (+ (/ pi 2) (angle pt1 pt2)) 1))
(setq pt5 (inters pt3 pt4 pt1 pt5 nil))
(setq var1 (equal (car pt1) (car pt5) 0.00000001)
var2 (equal (cadr pt1) (cadr pt5) 0.00000001)
)
(if (and (not var1) (not var2))
(exit)
)
(setq ent2 (subst (cons 10 (car ptlist)) (assoc 10 ent2) ent2))
(setq ent2 (subst (cons 11 (cadr ptlist)) (assoc 11 ent2) ent2))
(entmod ent2)
(entdel (cdr (assoc -1 ent1)))
(princ)
);progn
(princ "it's wrong")
);if
);progn
);if
(setq i (1+ i))
);repeat
(princ (1+ i))
(princ "ok")
(setvar "osmode" 703)
(command "_ucs" "p")
(setvar "cmdecho" 1)
(princ)
)
热心网友
时间:2022-06-29 05:26
简单些!
使用“倒角”或“倒圆”命令,输入“D”值或“R”值等于0,分别选两条线回车即成!
热心网友
时间:2022-06-29 05:26
先延伸,两条线相交,输入:PE 回车,会有提示合并还是怎么的,根据命令按下去就好了
热心网友
时间:2022-06-29 05:27
没相交,不能合并.但可以做成块,block,选择两条线段,ok,试一下
热心网友
时间:2022-06-29 05:28
先用f连上 在用pe合并