合并多段线,请大家帮忙看下合并多段线程序那里出了问题。
请大家帮忙看下合并多段线程序那里出了问题,请多多指教。(defun c:PE()
(setq ss (ssget))
(if (/= ss nil)
(progn
(setq nn (sslength ss))
(setq i 0)
(repeat nn
(setq sname (ssname ss i))
(setq en1 (entget sname))
(setq en2 (cdr (assoc 0 (entget sname))))
(if (and (/= en1 nil) (or (= en2 "LINE") (= en2 "ARC") (and (= en2 "LWPOLYLINE") (= (cdr (assoc 70 (entget sname))) 0))))
(progn
(setq en(cdr (assoc 0 (entget sname))))
(if (or (= en "LWPOLYLINE") (= en "POLYLINE"))
(command "pedit" sname "j" ss "" "")
(command "pedit" sname "y" "j" ss "" "")
);if
(setq i (+ i 1))
);progn
(setq i (+ i 1))
);if
);repeat
);progn
);if
)
(defun c:tt()
(setq ss (ssget '((0 . "arc,line,*polyline"))))
(if ss
(progn
(command "pedit" (setq e (ssname ss 0)))
(if (=(cdr (assoc 0 (entget e))) "LWPOLYLINE")
(command "y" "j" ss "" "")
(command"j" ss "" "")
)
))
)
(command "pedit" sname "j" ss "" "")和 (command "pedit" sname "y" "j" ss "" "")
都是对单个图元操作,能连接在一起么? Gu_xl 发表于 2011-11-2 17:42 static/image/common/back.gif
多谢版主,非常好用,简洁。高 vormittag 发表于 2011-11-2 17:47 static/image/common/back.gif
(command "pedit" sname "j" ss "" "")和 (command "pedit" sname "y" "j" ss "" "")
都是对单个图元操 ...
多谢指教 好像不能合并 Gu_xl 的程序确实不错,短小精悍。 (setq ss (ssget '((0 . "arc,line,*polyline"))))原来这里是支持通配符的。。。学习了 简单才是高手 Gu_xl 发表于 2011-11-2 17:42
你好,我用您的算法改了一下,想把样条曲线和多段线连接成多段线,但是总是出错,您能帮我看看吗?(defun c:tt()
(setq ss (ssget '((0 . "*polyline,spline"))))
(if ss
(progn
(command ".pedit" (setq e (ssname ss 0)))
(if (=(cdr (assoc 0 (entget e))) "LWPOLYLINE")
(command"m" ss "" "j" "1" "")
(command "m" ss "" "y" "10" "j" "1" "")
)
))
)
页:
[1]
2