<?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: arcpy copy/paste text element within an MXD in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-copy-paste-text-element-within-an-mxd/m-p/370048#M12726</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I came up with a working solution....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Still wondering if you can copy/paste though...?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Oct 2010 18:32:53 GMT</pubDate>
    <dc:creator>RyanKelley</dc:creator>
    <dc:date>2010-10-28T18:32:53Z</dc:date>
    <item>
      <title>arcpy copy/paste text element within an MXD</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-copy-paste-text-element-within-an-mxd/m-p/370047#M12725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am posting this question here as well the Map Automation Forum, since it pertains to python and this forum seems to get a lot more action.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My previous post (in the Map Automation Forum) regarding adding a text report of attribute data to an area in an MXD didn't yield any response, and probably isn't possible, so I am taking a new approach.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To keep things simple, I have a text element in my MXD called "StateText1".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When my cursor grabs the State attribute, it can replace that text string with the State. What I want to be able to do is, if there is more than one record, copy/paste that string (and rename it before I assign the value) to an x,y location. My python loop can then populate accordingly. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
rows = arcpy.SearchCursor("lyr_sort")
row = rows.next()

n = 1
xState = 9.2
y = 9.25
while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp; stateValue = row.getValue("PROJECT_STATE")
&amp;nbsp;&amp;nbsp;&amp;nbsp; for elm in MAP.ListLayoutElements(MXD, "TEXT_ELEMENT"):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if elm.text == "StateText" + str(n):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ###(HELP) copy text string to x,y and assign elm.text = str("StateText" + str(n + 1)) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if elm.text == "StateText" + str(n):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elm.text = (str(stateValue) + "\n")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elm.elementPositionX = xState
&amp;nbsp;&amp;nbsp;&amp;nbsp; y = y - 0.25
&amp;nbsp;&amp;nbsp;&amp;nbsp; elm.elementPositionY = y
&amp;nbsp;&amp;nbsp;&amp;nbsp; n = n + 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; row = rows.next()
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Oct 2010 16:45:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-copy-paste-text-element-within-an-mxd/m-p/370047#M12725</guid>
      <dc:creator>RyanKelley</dc:creator>
      <dc:date>2010-10-28T16:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy copy/paste text element within an MXD</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-copy-paste-text-element-within-an-mxd/m-p/370048#M12726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I came up with a working solution....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Still wondering if you can copy/paste though...?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Oct 2010 18:32:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-copy-paste-text-element-within-an-mxd/m-p/370048#M12726</guid>
      <dc:creator>RyanKelley</dc:creator>
      <dc:date>2010-10-28T18:32:53Z</dc:date>
    </item>
  </channel>
</rss>

