<?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: Replace characters in a text block in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-characters-in-a-text-block/m-p/9895536#M67100</link>
    <description>&lt;P&gt;Will FIND do what you want?&amp;nbsp; It can change text content within Attributes.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 19:04:51 GMT</pubDate>
    <dc:creator>Kent1Cooper</dc:creator>
    <dc:date>2020-11-25T19:04:51Z</dc:date>
    <item>
      <title>Replace characters in a text block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-characters-in-a-text-block/m-p/9895450#M67099</link>
      <description>&lt;P&gt;I have a text block, block name is "TITLEBLOCKTEXT"&lt;/P&gt;&lt;P&gt;The attribute tag is "PNUM"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to replace all instances of the character "A" with "J"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example = A001 changed to J001.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found how to change text strings, but nothing related to text in a block.&amp;nbsp; Any help is much appreciated!!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 18:27:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-characters-in-a-text-block/m-p/9895450#M67099</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T18:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Replace characters in a text block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-characters-in-a-text-block/m-p/9895536#M67100</link>
      <description>&lt;P&gt;Will FIND do what you want?&amp;nbsp; It can change text content within Attributes.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 19:04:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-characters-in-a-text-block/m-p/9895536#M67100</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-11-25T19:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Replace characters in a text block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-characters-in-a-text-block/m-p/9895539#M67101</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;check this one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&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;(defun c:A2J (/ ss old new)
 (if (setq ss (ssget '((0 . "insert") (2 . "titleblocktext") (66 . 1))))
  (foreach ename (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
   (if (not
          (vl-catch-all-error-p
            (setq old (vl-catch-all-apply
                               'getpropertyvalue (list ename "pnum")))
          )
       )
    (if (or
          (setq new (vl-string-subst "J" "A" old))
          (setq new (vl-string-subst "j" "a" old))
        )
     (vl-catch-all-apply 'setpropertyvalue (list ename "pnum" new))
    ); if
   ); if
  ); foreach  
 )

 (princ) 
)  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 19:06:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-characters-in-a-text-block/m-p/9895539#M67101</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2020-11-25T19:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Replace characters in a text block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-characters-in-a-text-block/m-p/9895544#M67102</link>
      <description>&lt;P&gt;That is going to find all letter A and I only want to replace the character in one attribute (PNUM).&amp;nbsp; The block contains 20+ attributes, so selecting it returns all character A's.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 19:08:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-characters-in-a-text-block/m-p/9895544#M67102</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T19:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Replace characters in a text block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-characters-in-a-text-block/m-p/9895549#M67103</link>
      <description>&lt;P&gt;It works great except it is asking for me to select objects.&amp;nbsp; Can it select the block text automatically rather than having to select it manually?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 200 drawings I need to change&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 19:17:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-characters-in-a-text-block/m-p/9895549#M67103</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T19:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Replace characters in a text block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-characters-in-a-text-block/m-p/9895568#M67104</link>
      <description>&lt;P&gt;Changing the top line to..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(setq ss (ssget "x" '((0 . "insert") (66 . 1) (2 . "TITLEBLOCKTEXT"))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Makes it work perfectly.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 19:25:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-characters-in-a-text-block/m-p/9895568#M67104</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T19:25:07Z</dc:date>
    </item>
  </channel>
</rss>

