[求助]如何去掉参照图层的前缀?
<p>把图A用外捕参照,然后绑定</p><p>结果图A中的图层就都有了个前缀" A$0$"</p><p>请问有没有快捷的方法去掉这个前缀?</p><p>我一个个去图层中修改名字实在是太麻烦了</p><p></p><p>请大家帮忙!</p><p>谢谢</p> hnfsf 发表于 2013-5-12 23:45(defun c:tt ()
(while (setq TBL (tblnext "layer" (null TBL)))
(setq TBL_LIST (cons (cdr ...
hnfsf大侠,可以把你这个深化下吗?
如下深化
绑定参照后,把带进的图层名字和线型名字$0$之前前缀全部删掉(图纸说不定被二次参照,名字带有两个或三个$0$)
删除前缀时,如果有名字重合,则可以合并名字,如果不能合并,就在名字后面加个数字,比如1(加数字后,如果还有重合,继续循环运行加数字1,直到不重合) 用不了啊,大侠,盼回复 将外部参照绑定后图层前缀就没了。 就是绑定后才会出现前缀$0$的啊 <p>LS是什么版本?</p><p>CAD2004好象没有这个对话框啊</p> <p>输入 XR后,</p><p>再按BIND按钮,就会有这个对话框 </p> <p>谢谢</p><p>我明白了</p><p></p> (defun c:tt ()
(while (setq TBL (tblnext "layer" (null TBL)))
(setq TBL_LIST (cons (cdr (assoc 2 TBL)) TBL_LIST)))
(setq lys (vla-get-Layers (setq AcDocument (vla-get-ActiveDocument (vlax-get-acad-object)))) ly1 TBL_LIST)
(vlax-for ly lys
(setq b (vlax-get-property ly "Name"))
(if (wcmatch b "*$0$*")
(Progn
(setq c (cadr (@Fsf-Split b "$0$")))
(if (member c TBL_LIST)
(vla-put-name ly (strcat c "-1"));(command "_.CHPROP" (ssget "x" (list (cons 8 (strcat "*$0$" c)))) "" "LA" c "")
(vla-put-name ly c)))
)
)
(princ)
) (defun @Fsf-Split (string strkey / po strlst xlen)
(setq xlen (1+ (strlen strkey)))
(while (setq po (vl-string-search strkey string))
(setq strlst (cons (substr string 1 po) strlst))
(setq string (substr string (+ po xlen)))
)
(reverse (cons string strlst))
) 8楼与9楼的程序是一样的还是说9楼的程序是接在8楼后面的呢
页:
[1]
2