Designer 发表于 2022-7-6 09:07:40

分层搜索和替换

你好
是否有一个lisp可以搜索图层名称,然后替换我们想要的名称,比如,我有5个以CCF2开头的图层,我想将其更改为CCF3,这可能吗?
 
干杯

BIGAL 发表于 2022-7-6 09:12:56

签出重命名ccf2*现在ccf3*全部完成

Designer 发表于 2022-7-6 09:15:17

您好,它没有将ccf2重命名为ccf3,而是在ccf2之前添加了ccf3。

Tharwat 发表于 2022-7-6 09:19:52

我认为Bigal指示命令“重命名”。
 
为什么这对你不起作用?
 
你是怎么做到的?

Designer 发表于 2022-7-6 09:23:24

我使用了comand*rename*,然后我选择了我想要重命名的层并编写了ccf3*
我想重命名eg_
ccf2\u 0\u LT\u房屋
ccf2\u 1\u LT\u花园
 

 
ccf3\u 0\u LT\u房屋
ccf3\u 1\u LT\u花园

Tharwat 发表于 2022-7-6 09:24:15

试试这个伙计。
 
(defun c:test (/ old new)
;; Tharwat 26. 07. 2011
(cond ((not
          (setq old (getstring T "\n Enter name of Existed Layer:"))
      )
       )
       ((not (setq new
                  (getstring T "\n Enter The New name of Layer to rename :")
             )
      )
       )
       ((not (tblsearch "LAYER" old))
      (princ "\n Name of Layer is not existed ")
       )
       ((progn (command "_.-rename" "_Layer" old new)
               (princ "\n Well done >> ")
      )
       )
)
(princ)
)
Tharwat

Designer 发表于 2022-7-6 09:29:24

这是可行的,但我必须一层一层地做,有没有办法同时对所有层做这件事?我要换120层

Tharwat 发表于 2022-7-6 09:32:33

写下图形中现有图层的名称,以及每个图层的新名称。

Designer 发表于 2022-7-6 09:35:51

这就像一个接一个的改变,这就是我一直在做的。我想在同一时间改变一切,像重命名comand,但它与替换comand集成。

BIGAL 发表于 2022-7-6 09:39:17

RENAME明确允许根据我的第一篇文章进行通配符更改RENAME x*to Y*将只需几秒钟即可手动将x更改为Y。更不用说写lisp等了。
 
试试看。
页: [1] 2
查看完整版本: 分层搜索和替换