<?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: How to Delete a text element (text box) in an mxd? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-delete-a-text-element-text-box-in-an-mxd/m-p/168696#M12995</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;FYI&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/26979-Deleting-Layout-Elements-with-arcpy.mapping"&gt;http://forums.arcgis.com/threads/26979-Deleting-Layout-Elements-with-arcpy.mapping&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Closest thing you can do is set height/width to zero.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jun 2011 16:26:52 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2011-06-09T16:26:52Z</dc:date>
    <item>
      <title>How to Delete a text element (text box) in an mxd?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-delete-a-text-element-text-box-in-an-mxd/m-p/168695#M12994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am creating a program to run through a number of mxd's to change some text elements for final delivery to my client. In the process, I want to delete a text element that says "DRAFT" in each .mxd when the program runs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
for textElement in arcpy.mapping.ListLayoutElements(mxd2, "TEXT_ELEMENT"):

&amp;nbsp;&amp;nbsp;&amp;nbsp; if textElement.text == "DRAFT": 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del textElement
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "No DRAFT"
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried &lt;/SPAN&gt;&lt;STRONG&gt;del textElement&lt;/STRONG&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;STRONG&gt;textElement.delete&lt;/STRONG&gt;&lt;SPAN&gt;, neither seem to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also tried setting the text box to nothing (ie textElement.text = "") but I need to actually get rid of the text box.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2011 16:09:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-delete-a-text-element-text-box-in-an-mxd/m-p/168695#M12994</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2011-06-09T16:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete a text element (text box) in an mxd?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-delete-a-text-element-text-box-in-an-mxd/m-p/168696#M12995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;FYI&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/26979-Deleting-Layout-Elements-with-arcpy.mapping"&gt;http://forums.arcgis.com/threads/26979-Deleting-Layout-Elements-with-arcpy.mapping&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Closest thing you can do is set height/width to zero.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2011 16:26:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-delete-a-text-element-text-box-in-an-mxd/m-p/168696#M12995</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-06-09T16:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to Delete a text element (text box) in an mxd?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-delete-a-text-element-text-box-in-an-mxd/m-p/168697#M12996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the response Matthew. Looks like I am setting it to " "&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2011 16:39:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-delete-a-text-element-text-box-in-an-mxd/m-p/168697#M12996</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2011-06-09T16:39:32Z</dc:date>
    </item>
  </channel>
</rss>

