bono05 发表于 2022-7-5 17:49:15

查找并替换文本。。。但关于

你好
 
有可能找到这个吗?
我需要从dwg中重命名地块布局的名称(对于示例):
 
 
00.1层-->01.1层
00.2层-->01.2层
00.3层-->01.3层
 
谢谢

Tharwat 发表于 2022-7-5 18:04:17

你好
 
您是在讨论示例中的特定布局名称,还是所有布局都要扣除左侧的零?
 
展示一个例子。

bono05 发表于 2022-7-5 18:15:40

正如你们在这里看到的,我需要替换:
 
附录A1。xx至应用A2。xx(二楼)
附录A1。xx至APP A3。xx(第三层)。。。
 
http://img15.hostingpics.net/pics/474802image001.png

Tharwat 发表于 2022-7-5 18:24:51

重命名布局必须遵循一个标准,那么在您的情况下,原则是什么?

bono05 发表于 2022-7-5 18:36:14

我在网上找到这个。。。它看起来就像是一个查找-替换-仅用于布局!
你觉得这个怎么样?
 
(defun c:FRlayout (/ #Find #Replace)
(vl-load-com)
(and
   (setq #Find (getstring T "\nFind what: "))
   (setq #Replace (getstring T "\nReplace with: "))
   (not (vl-position "" (list #Find #Replace)))
   (vlax-for x (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
   (vl-catch-all-apply 'vla-put-name (list x (vl-string-subst #Replace #Find (vla-get-name x))))
   ) ;_ vlax-for
) ;_ and
(princ)
) ;_ defun

BIGAL 发表于 2022-7-5 18:48:43

当你获得布局名称时,你还需要像lee macs parse numbers这样的东西。使用parse numbers返回1.02,并检查其是否在你想要更改的布局范围内。开始=“App 1.03”结束=“App 1.11”给出1.031.11等,然后只更改正确的布局。你的代码就快到了。

asos2000 发表于 2022-7-5 18:55:24

试试这个
http://www.lee-mac.com/tabsort.html
页: [1]
查看完整版本: 查找并替换文本。。。但关于