<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Find text, change layer in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060557#M138836</link>
    <description>&lt;P&gt;Try something like this:&lt;/P&gt;&lt;PRE&gt;(defun c:foo (/ s)
  ;; RJP » 2019-10-01
  ;; Add to the list below of layers to look for and target layer to place text 
  (foreach l '(("LAYERNAME" "NEWLAYERNAME")
	       ("LAYERNAME1" "NEWLAYERNAME1")
	       ("LAYERNAME2" "NEWLAYERNAME2")
	       ("LAYERNAME3" "NEWLAYERNAME3")
	       ;; Can combine multiple layers like so to put on a single target layer :)
	       ("TEST,123,RJP" "NEWLAYERNAME3")
	       ;; Partial string match
	       ("*FUNKY*" "Chicken")
	      )
    (if	(setq s (ssget "_X" (list '(0 . "*TEXT") (cons 8 (car l)))))
      (foreach e (mapcar 'cadr (ssnamex s)) (entmod (append (entget e) (list (cons 8 (cadr l))))))
    )
  )
  (princ)
)&lt;/PRE&gt;</description>
    <pubDate>Tue, 01 Oct 2019 18:35:08 GMT</pubDate>
    <dc:creator>ronjonp</dc:creator>
    <dc:date>2019-10-01T18:35:08Z</dc:date>
    <item>
      <title>Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/5795746#M138832</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to lisps and the syntax is a little confusing to me so I'm having a little trouble. I have a text layer that contains around 500 text and mtext strings. I need to search for a string within the text and if it matches, change the layer. Here's an example of the logic:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;find "HW"&amp;nbsp;&lt;/P&gt;&lt;P&gt;change object layer to "HW-TXT"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;find "WFI"&amp;nbsp;&lt;/P&gt;&lt;P&gt;change object layer to "WFI-TXT"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;find "CHWS"&lt;/P&gt;&lt;P&gt;change object layer to "CHWS-TXT"&lt;/P&gt;&lt;P&gt;ect...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If possible, it would be nice to be able to view the object before the layer is changed similar to how you can view all of the text when you use find and replace before replacing it but it's not absolutely necessary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 13:43:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/5795746#M138832</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-31T13:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/5796028#M138833</link>
      <description>(defun C:ChgText (/)&lt;BR /&gt;  (if (setq SS (ssget "X" (list (cons 0 "TEXT,MTEXT") (cons 1 "HW"))))&lt;BR /&gt;    (progn&lt;BR /&gt;      (if (not (tblsearch "LAYER" "HW-TXT")) (command "LAYER" "M" "HW-TXT" ""))&lt;BR /&gt;      (setq KK 0)&lt;BR /&gt;      (while (&amp;lt; KK (sslength SS))&lt;BR /&gt;	(command "ZOOM" "C" (cdr (assoc 10 (entget (ssname SS KK)))) "")&lt;BR /&gt;	(if (= "Y" (strcase (getstring "\nChange Text - {y}=Yes or {n}=No ? ")))&lt;BR /&gt;          (command "CHPROP" SS "" "LA" "HW-TXT" "")&lt;BR /&gt;	)&lt;BR /&gt;	(setq KK (1+ KK))&lt;BR /&gt;      )&lt;BR /&gt;    )&lt;BR /&gt;  )&lt;BR /&gt;  (princ)&lt;BR /&gt;)</description>
      <pubDate>Mon, 31 Aug 2015 15:54:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/5796028#M138833</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-31T15:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/5796113#M138834</link>
      <description>&lt;P&gt;That worked great, thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand enough of what you wrote to add the remaining layers and strings. thanks&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 16:32:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/5796113#M138834</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-31T16:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060494#M138835</link>
      <description>&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #666666; cursor: text; font-family: inherit; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.7142; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;This solution works great&lt;/SPAN&gt; &amp;nbsp; --- &amp;nbsp; any chance multiple text strings could be found and the layer changed globally inside of one lisp command??&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 18:18:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060494#M138835</guid>
      <dc:creator>phillip.curlin</dc:creator>
      <dc:date>2019-10-01T18:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060557#M138836</link>
      <description>&lt;P&gt;Try something like this:&lt;/P&gt;&lt;PRE&gt;(defun c:foo (/ s)
  ;; RJP » 2019-10-01
  ;; Add to the list below of layers to look for and target layer to place text 
  (foreach l '(("LAYERNAME" "NEWLAYERNAME")
	       ("LAYERNAME1" "NEWLAYERNAME1")
	       ("LAYERNAME2" "NEWLAYERNAME2")
	       ("LAYERNAME3" "NEWLAYERNAME3")
	       ;; Can combine multiple layers like so to put on a single target layer :)
	       ("TEST,123,RJP" "NEWLAYERNAME3")
	       ;; Partial string match
	       ("*FUNKY*" "Chicken")
	      )
    (if	(setq s (ssget "_X" (list '(0 . "*TEXT") (cons 8 (car l)))))
      (foreach e (mapcar 'cadr (ssnamex s)) (entmod (append (entget e) (list (cons 8 (cadr l))))))
    )
  )
  (princ)
)&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Oct 2019 18:35:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060557#M138836</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2019-10-01T18:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060562#M138837</link>
      <description>Thanks will give it a try.&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Oct 2019 18:37:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060562#M138837</guid>
      <dc:creator>phillip.curlin</dc:creator>
      <dc:date>2019-10-01T18:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060715#M138838</link>
      <description>&lt;P&gt;what i am trying to do is find all occurrences of the text string "*CAD WELD" on layer G-ANNO-TEXT and move that text string to layer G-ANNO-TEXT-YELL &lt;STRONG&gt;globally on multiple page layouts.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;All text strings are on layer &lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #666666; cursor: text; font-family: inherit; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.7142; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;G-ANNO-TEXT &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;below was my attempt - it puts all text on layer G-ANNO-TEXT on layer&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #666666; cursor: text; font-family: inherit; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 1.7142; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;G-ANNO-TEXT-YELL&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="station string text .jpg" style="width: 666px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/683376i5E57DA4D9C7B4C1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="station string text .jpg" alt="station string text .jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(defun c:CHGTEXT-ALL (/ s)&lt;BR /&gt;;; RJP » 2019-10-01&lt;BR /&gt;;; Add to the list below of layers to look for and target layer to place text&lt;BR /&gt;(foreach l '(("LAYERNAME" "G-ANNO-TEXT")&lt;BR /&gt;;; Can combine multiple layers like so to put on a single target layer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;("G-ANNO-TEXT" "G-ANNO-TEXT-YELL")&lt;BR /&gt;;; Partial string match&lt;BR /&gt;("*CAD WELD")&lt;BR /&gt;)&lt;BR /&gt;(if (setq s (ssget "_X" (list '(0 . "*TEXT") (cons 8 (car l)))))&lt;BR /&gt;(foreach e (mapcar 'cadr (ssnamex s)) (entmod (append (entget e) (list (cons 8 (cadr l))))))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 19:31:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060715#M138838</guid>
      <dc:creator>phillip.curlin</dc:creator>
      <dc:date>2019-10-01T19:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060752#M138839</link>
      <description>&lt;P&gt;Try this .. had to make the filter look for text strings on a certain layer.&lt;/P&gt;&lt;PRE&gt;(defun c:chgtext-all (/ s)
  ;; RJP » 2019-10-01
  ;; List of text string to match, layer filter, new layer
  (foreach l '(("*CAD WELD" "G-ANNO-TEXT" "G-ANNO-TEXT-YELL"))
    (if	(setq s (ssget "_X" (list '(0 . "*TEXT") (cons 1 (car l)) (cons 8 (cadr l)))))
      (foreach e (mapcar 'cadr (ssnamex s)) (entmod (append (entget e) (list (cons 8 (caddr l))))))
    )
  )
  (princ)
)&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Oct 2019 19:42:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060752#M138839</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2019-10-01T19:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060794#M138840</link>
      <description>&lt;P&gt;i appreciate you time - it works great.&lt;/P&gt;&lt;P&gt;is there anyway to add multiple text strings in this command.&lt;/P&gt;&lt;P&gt;if not this is a huge time save as is - many thanks to all of you out there.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 19:56:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060794#M138840</guid>
      <dc:creator>phillip.curlin</dc:creator>
      <dc:date>2019-10-01T19:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060801#M138841</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4069814"&gt;@phillip.curlin&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;i appreciate you time - it works great.&lt;/P&gt;&lt;P&gt;is there anyway to add multiple text strings in this command.&lt;/P&gt;&lt;P&gt;if not this is a huge time save as is - many thanks to all of you out there.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Sure .. separate the strings you want to look for with commas like so:&lt;/P&gt;&lt;PRE&gt;'(("*CAD WELD,*ANOTHERSTRING*,*ETC*" "G-ANNO-TEXT" "G-ANNO-TEXT-YELL"))&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Oct 2019 19:58:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/9060801#M138841</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2019-10-01T19:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/11314994#M138842</link>
      <description>&lt;P&gt;Thank you very much for this! I've been using this lisp A LOT for a while now! But its only until now that I wonder if it could be possible to write directly on the command line exactly the text I want to look for? Normaly, I go ahed and edit the code to search for a specific text and then also edit the lines where I want the layer to be named how I want the new layer to be named. But recently, I've been wondering if I really need to do that on the text editor? Is there a way to add the function to this lisp to ask to write the exact text Im looking for and the name of the new layer Im creating?&amp;nbsp;&lt;BR /&gt;Thanks in advance for your kind answer!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 21:32:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/11314994#M138842</guid>
      <dc:creator>AKeyM</dc:creator>
      <dc:date>2022-07-22T21:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/11315191#M138843</link>
      <description>&lt;P&gt;Look at ronjonp code, keep the foreach part but before it make the list&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(foreach l '(("*CAD WELD" "G-ANNO-TEXT" "G-ANNO-TEXT-YELL"))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(setq lst '())
(setq lst (cons (getstring "\nEnter string to find include * ") lst))
(setq lst (cons (getstring "\nEnter old layer name ") lst))
(setq lst (cons (getstring "\nEnter new layer name ") lst))
(foreach l lst&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jul 2022 02:44:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/11315191#M138843</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2022-07-23T02:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/11340394#M138844</link>
      <description>&lt;P&gt;Thank you very much for your response. Could you please make a short example? For instance, I'm frequently finding myself searching for texts like, P-1, P-2, P-3 and so on. All can be on a different layer. I'd like to find them (regardless of which layer they are on) and sort them on a new layer for each text targeted. For this example, the result would end up finding P-1, then generating a new layer for P-1 (tipically X-P-1), and repeat the same process for P-2, (on a new layer named X-P-2), the same for P-3 and so on.&lt;/P&gt;&lt;P&gt;I've been using&amp;nbsp;@Anonymous&amp;nbsp;&amp;nbsp;code for the past 3 years or so, but I always ended up with a bunch of lisps for every project.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 15:56:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/11340394#M138844</guid>
      <dc:creator>AKeyM</dc:creator>
      <dc:date>2022-08-04T15:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/11341248#M138845</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(while (/= (setq str1 (getstring "\nEnter string to find include * Enter to exit ")) "")
(setq lst '())
(setq lst (cons str1 lst))
(setq lst (cons (getstring "\nEnter old layer name ") lst))
(setq lst (cons (getstring "\nEnter new layer name ") lst))

(foreach l lst

........................
) ; end while&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 01:45:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/11341248#M138845</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2022-08-05T01:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/11342750#M138846</link>
      <description>&lt;P&gt;I wrote this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:SEARCH (/)&lt;BR /&gt;(if (setq SS (ssget "X" (list (cons 0 "TEXT,MTEXT") (cons 1 (getstring "\nTEXT TO SEARCH ")))))&lt;BR /&gt;(progn&lt;BR /&gt;(setq XX (getstring "\nNEW LAYER NAME "))&lt;BR /&gt;(if (not (tblsearch "LAYER" XX)) (command "LAYER" "M" XX ""))&lt;BR /&gt;(setq KK 0)&lt;BR /&gt;(command "CHPROP" SS "" "LA" XX "")&lt;BR /&gt;)&lt;BR /&gt;(setq KK (1+ KK))&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;(alert "Done!")&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It searches for a specific text, then makes a layer with the name of your choosing and then changes properties of every element found to be the on the new layer that it just created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now I'm getting trouble since some texts are in leaders with arrows, so I have to explode those to transform them into searchable text.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 17:24:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/11342750#M138846</guid>
      <dc:creator>AKeyM</dc:creator>
      <dc:date>2022-08-05T17:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Find text, change layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/11346901#M138847</link>
      <description>&lt;P&gt;After lots of trial and errors, finally I corrected some lines and now it works on Text, Mtext and Multileaders.&lt;/P&gt;&lt;P&gt;Also it performs the search on a specific area, instead of the entire project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:SEARCH (/)&lt;/P&gt;&lt;P&gt;;; ALAN KEY » 2022-08-05&lt;BR /&gt;(setq&lt;BR /&gt;AA (getstring T "\nTEXT TO SEARCH: ")&lt;BR /&gt;)&lt;BR /&gt;(if (and (setq text AA)&lt;BR /&gt;(setq ss (ssget ":L" (list '(0 . "TEXT,MTEXT,MULTILEADER") (cons 304 (strcat "*" text "*"))))))&lt;BR /&gt;(sssetfirst nil ss)&lt;BR /&gt;)&lt;BR /&gt;(progn&lt;BR /&gt;(setq XX (getstring "\nNEW LAYER NAME: "))&lt;BR /&gt;(if (not (tblsearch "LAYER" XX)) (command "LAYER" "M" XX ""))&lt;BR /&gt;(setq KK 0)&lt;BR /&gt;(command "CHPROP" SS "" "LA" XX "")&lt;BR /&gt;)&lt;BR /&gt;(setq KK (1+ KK))&lt;BR /&gt;)&lt;BR /&gt;(alert "DONE!")&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That was really hard to me, I'm still learning by reading some tutorials and lots of youtube videos.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 17:05:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-change-layer/m-p/11346901#M138847</guid>
      <dc:creator>AKeyM</dc:creator>
      <dc:date>2022-08-08T17:05:03Z</dc:date>
    </item>
  </channel>
</rss>

