求LISP程序:一键连接相邻线段连接成多段线,如封闭则生成封闭多段线
求LISP程序:一键连接相邻线段连接成多段线,如封闭则生成封闭多段线(defun c:tt (/ en)
(setq en (entsel "\n点基线:"))
(command ".pedit" en "J" "all" "" "")
(princ)
) JOIN + PEDIT就行了 (defun c:dxd( / sset i ent entpar dxf70)
(setq sset (ssget (list (cons 0 "*line,arc"))))
(vl-cmdf "undo" "be")
(setvar "peditaccept" 1)
(setq i -1)
(while (setq ent (ssname sset (setq i (1+ i))))
(if (setq entpar (entget ent))
(if (setq dxf70 (assoc 70 entpar))
(if (/= 1 (cdr dxf70))
(vl-cmdf "pedit" ent "j" sset "" "")
)
(vl-cmdf "pedit" ent "j" sset "" "")
))
)
(vl-cmdf "undo" "e")
(princ)
) 本帖最后由 fengyu6913 于 2024-3-14 22:58 编辑
uualice2020 发表于 2024-3-13 19:55
(defun c:dxd( / sset i ent entpar dxf70)
(setq sset (ssget (list (cons 0 "*line,arc"))))
需要全选,理想效果是选一根线段,输入命令后能把相连接的线段自动都连成一根多段线 kozmosovia 发表于 2024-3-13 19:45
JOIN + PEDIT就行了
之前J命令就可以解决了,最近装了点东西把“J”的功能弄没了
用JOIN也行,就是要全选,有时全选又太麻烦 (defun c:tt ()
(if (setq ss (ssget))(command "pedit" "m" ss "" "j" "0" ""))
(princ)
) xyp1964 发表于 2024-3-14 13:18
(defun c:tt ()
(if (setq ss (ssget))(command "pedit" "m" ss "" "j" "0" ""))
(princ)
需要全选,理想效果是选一根线段,输入命令后能把相连接的线段自动都连成一根多段线 类似的程序坛子里有,搜一下就有 借花献佛,超快的,这是 本站“Urings” 的神奇程序。
号称 “LISP 聚合 10000 个实体6秒”
页:
[1]
2