明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2332|回复: 7

兩個編輯多義線的程序

[复制链接]
发表于 2004-12-21 15:05 | 显示全部楼层 |阅读模式
(defun c:j (/ join-ss rep1 len entnam enti)
(setvar "CMDECHO" 0)
(setq join-ss (ssget '((-4 . "<OR")
(0 . "LINE")
(0 . "ARC")
(-4 . "<AND")
(0 . "POLYLINE")
(70 . 0)
(-4 . "AND>")
(-4 . "<AND")
(0 . "LWPOLYLINE")
(70 . 0)
(-4 . "AND>")
(-4 . "OR>")
)
)
)
(if (not join-ss)
(exit)
)
(vl-cmdf "_.undo" "begin")
(setq rep1 0)
(setq len (sslength join-ss))
(terpri)
(repeat len
(setq entnam (ssname join-ss rep1))
(setq enti (entget entnam))
(princ (strcat "\rProcessing line " (itoa (1+ rep1)) " of " (itoa len)))
(if enti
(if (or (= (cdr (assoc 0 enti)) "POLYLINE")
(= (cdr (assoc 0 enti)) "LWPOLYLINE")
)
(command "_.pedit" entnam "j" join-ss "" "x")
(command "_.pedit" entnam "y" "j" join-ss "" "x")
)
)
(setq rep1 (1+ rep1))
)
(vl-cmdf "_.undo" "end")
(setvar "CMDECHO" 1)
(princ)
)
;;***************************
(defun c:jj (/ join-ss rep1 len entnam enti)
(setvar "CMDECHO" 0)
(setq join-ss (ssget '((-4 . "<OR")
(0 . "LINE")
(0 . "ARC")
(-4 . "<AND")
(0 . "POLYLINE")
(70 . 0)
(-4 . "AND>")
(-4 . "<AND")
(0 . "LWPOLYLINE")
(70 . 0)
(-4 . "AND>")
(-4 . "OR>")
)
)
)
(setq join-ss1 (ssget "x"
'((-4 . "<OR")
(0 . "LINE")
(0 . "ARC")
(-4 . "<AND")
(0 . "POLYLINE")
(70 . 0)
(-4 . "AND>")
(-4 . "<AND")
(0 . "LWPOLYLINE")
(70 . 0)
(-4 . "AND>")
(-4 . "OR>")
)
)
)
(vl-cmdf "_.undo" "begin")
(if (not join-ss)
(exit)
)
(setq rep1 0)
(setq len (sslength join-ss))
(terpri)
(repeat len
(if (setq entnam (ssname join-ss rep1))
(progn
(setq enti (entget entnam))
(princ (strcat "\rProcessing line " (itoa (1+ rep1)) " of " (itoa len)))
(if enti
(if (or (= (cdr (assoc 0 enti)) "POLYLINE")
(= (cdr (assoc 0 enti)) "LWPOLYLINE")
)
(command "_.pedit" entnam "j" join-ss1 "" "")
(command "_.pedit" entnam "y" "j" join-ss1 "" "")
)
)
)
)
(setq rep1 (1+ rep1))
)
(vl-cmdf "_.undo" "end")
(setvar "CMDECHO" 1)
(princ)
)
发表于 2004-12-22 14:30 | 显示全部楼层
感谢分享
发表于 2004-12-28 22:19 | 显示全部楼层
感谢分享
发表于 2012-2-4 15:32 | 显示全部楼层
怎么用呀
发表于 2012-3-14 10:41 | 显示全部楼层
不好使。
Processing line 1 of 1
发表于 2012-3-20 21:32 | 显示全部楼层
顶顶顶顶顶顶
发表于 2012-4-22 21:27 | 显示全部楼层
作用是什么???
发表于 2012-9-26 11:54 | 显示全部楼层
程序的效果是什么啊?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-15 07:18 , Processed in 0.942658 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表