<?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: I Want to delete some text element but my script is not working in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/i-want-to-delete-some-text-element-but-my-script/m-p/46463#M3739</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Think I figured it out. Wildcard needs a wildcard:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;mxd = arcpy.mapping.MapDocument("Current") tableText = arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "TableText")[0] for elm in arcpy.mapping.ListLayoutElements(mxd, wildcard="*_clone"): &amp;nbsp;&amp;nbsp;&amp;nbsp; print elm.name #just to double check you're actually getting results in the list &amp;nbsp;&amp;nbsp;&amp;nbsp; elm.delete()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Oct 2013 16:48:19 GMT</pubDate>
    <dc:creator>MattSayler</dc:creator>
    <dc:date>2013-10-02T16:48:19Z</dc:date>
    <item>
      <title>I Want to delete some text element but my script is not working</title>
      <link>https://community.esri.com/t5/python-questions/i-want-to-delete-some-text-element-but-my-script/m-p/46460#M3736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I created some text element by cloning the original text element, I intend to delete all the cloned text elements after using them but after running my script it does not work at all, any suggestions. The cloned text elements are named Table Text_clone1, Table text_clone2 etc, see my code below&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;gt;&amp;gt;&amp;gt; mxd = arcpy.mapping.MapDocument("Current") &amp;gt;&amp;gt;&amp;gt; tableText = arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "TableText")[0] &amp;gt;&amp;gt;&amp;gt; for elm in arcpy.mapping.ListLayoutElements(mxd, wildcard="_clone"): ...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elm.delete() ... &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 16:20:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-want-to-delete-some-text-element-but-my-script/m-p/46460#M3736</guid>
      <dc:creator>OLANIYANOLAKUNLE</dc:creator>
      <dc:date>2013-10-02T16:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: I Want to delete some text element but my script is not working</title>
      <link>https://community.esri.com/t5/python-questions/i-want-to-delete-some-text-element-but-my-script/m-p/46461#M3737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What version of ArcGIS are you on (10.0 and under don't have the delete() method)?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 16:28:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-want-to-delete-some-text-element-but-my-script/m-p/46461#M3737</guid>
      <dc:creator>MattSayler</dc:creator>
      <dc:date>2013-10-02T16:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: I Want to delete some text element but my script is not working</title>
      <link>https://community.esri.com/t5/python-questions/i-want-to-delete-some-text-element-but-my-script/m-p/46462#M3738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;What version of ArcGIS are you on (10.0 and under don't have the delete() method)?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Version 10.1&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 16:43:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-want-to-delete-some-text-element-but-my-script/m-p/46462#M3738</guid>
      <dc:creator>OLANIYANOLAKUNLE</dc:creator>
      <dc:date>2013-10-02T16:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: I Want to delete some text element but my script is not working</title>
      <link>https://community.esri.com/t5/python-questions/i-want-to-delete-some-text-element-but-my-script/m-p/46463#M3739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Think I figured it out. Wildcard needs a wildcard:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;mxd = arcpy.mapping.MapDocument("Current") tableText = arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "TableText")[0] for elm in arcpy.mapping.ListLayoutElements(mxd, wildcard="*_clone"): &amp;nbsp;&amp;nbsp;&amp;nbsp; print elm.name #just to double check you're actually getting results in the list &amp;nbsp;&amp;nbsp;&amp;nbsp; elm.delete()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 16:48:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-want-to-delete-some-text-element-but-my-script/m-p/46463#M3739</guid>
      <dc:creator>MattSayler</dc:creator>
      <dc:date>2013-10-02T16:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: I Want to delete some text element but my script is not working</title>
      <link>https://community.esri.com/t5/python-questions/i-want-to-delete-some-text-element-but-my-script/m-p/46464#M3740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Think I figured it out. Wildcard needs a wildcard:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument("Current")
tableText = arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "TableText")[0]
for elm in arcpy.mapping.ListLayoutElements(mxd, wildcard="*_clone"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; print elm.name #just to double check you're actually getting results in the list
&amp;nbsp;&amp;nbsp;&amp;nbsp; elm.delete()&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks it worked perfectly!!! Although i added an extra *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for elm in arcpy.mapping.ListLayoutElements(mxd, wildcard="*_clone*"):&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:49:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-want-to-delete-some-text-element-but-my-script/m-p/46464#M3740</guid>
      <dc:creator>OLANIYANOLAKUNLE</dc:creator>
      <dc:date>2021-12-10T21:49:17Z</dc:date>
    </item>
  </channel>
</rss>

