<?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 Dynamic Text in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/dynamic-text/m-p/708366#M54902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I'm looking to add dynamic text to data driven pages. The text is areas from an attribute table from a polygon feature class that must change with each map layout. I have 180 gravel pits and i need to display each individual area in Hectares on each page. For example map 1 is titled "Pit 1 Site Plan", 2 is "Pit 2 site Plan". Now I need to have the area of site 1 on map 1 and the area of site 2 on map 2 and so on. Can anyone help me out? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 May 2012 17:30:01 GMT</pubDate>
    <dc:creator>AaronNotte</dc:creator>
    <dc:date>2012-05-03T17:30:01Z</dc:date>
    <item>
      <title>Dynamic Text</title>
      <link>https://community.esri.com/t5/python-questions/dynamic-text/m-p/708366#M54902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I'm looking to add dynamic text to data driven pages. The text is areas from an attribute table from a polygon feature class that must change with each map layout. I have 180 gravel pits and i need to display each individual area in Hectares on each page. For example map 1 is titled "Pit 1 Site Plan", 2 is "Pit 2 site Plan". Now I need to have the area of site 1 on map 1 and the area of site 2 on map 2 and so on. Can anyone help me out? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 17:30:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamic-text/m-p/708366#M54902</guid>
      <dc:creator>AaronNotte</dc:creator>
      <dc:date>2012-05-03T17:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Text</title>
      <link>https://community.esri.com/t5/python-questions/dynamic-text/m-p/708367#M54903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You just want to edit the built in dynamic text to display a custom title?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like this? Which uses the page number as the Pit title.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;Pit &amp;lt;dyn type="page" property="number"/&amp;gt; Site Plan&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 17:44:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamic-text/m-p/708367#M54903</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-05-03T17:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Text</title>
      <link>https://community.esri.com/t5/python-questions/dynamic-text/m-p/708368#M54904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No i have the pit title labeled already. I am looking to have the area of the polygon displayed and then as you click through the dynamic pages i want the area to automatically update to the corrisponding pit being shown.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 17:50:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamic-text/m-p/708368#M54904</guid>
      <dc:creator>AaronNotte</dc:creator>
      <dc:date>2012-05-03T17:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Text</title>
      <link>https://community.esri.com/t5/python-questions/dynamic-text/m-p/708369#M54905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Oh you mean the shape area of the feature? If you want that as you are working in ArcMap, that would have to be ArcObjects.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could write a script that does that if you just want it for exporting. I've never tried it with data driven pages before, here's a bit of code to get you on the path.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for page in export_loop:
&amp;nbsp;&amp;nbsp;&amp;nbsp; layer = "data_driven_layer"
&amp;nbsp;&amp;nbsp;&amp;nbsp; ddp_field = "Field_Name"
&amp;nbsp;&amp;nbsp;&amp;nbsp; desc = arcpy.Describe(layer)
&amp;nbsp;&amp;nbsp;&amp;nbsp; shapeField = desc.shapeFieldName

&amp;nbsp;&amp;nbsp;&amp;nbsp; where = "%s = '%s'" %(ddp_field,ddp_value)
&amp;nbsp;&amp;nbsp;&amp;nbsp; s_cursor = arcpy.SearchCursor(layer,where)
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; page_area = row.getValue(shapeField).area
&amp;nbsp;&amp;nbsp;&amp;nbsp; for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if elm.name == "Dyn_Area":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elm.text = page_area&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: What Darren said below. My suggestion would be more use accessing other layers attributes based on the current data driven page.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:45:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamic-text/m-p/708369#M54905</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-12T05:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Text</title>
      <link>https://community.esri.com/t5/python-questions/dynamic-text/m-p/708370#M54906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can access any attribute in your index layer (ie. pits) using the dynamic text: &amp;lt;dyn type="page" property="thefieldname"/&amp;gt;. So, in your case, it would be: &amp;lt;dyn type="page" property="Shape_area"/&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s900000013000000.htm"&gt;help&lt;/A&gt;&lt;SPAN&gt; (waaaaay down, in a tip):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;With the &lt;BR /&gt;&lt;BR /&gt;dyn type="page" &lt;BR /&gt;&lt;BR /&gt;you can create dynamic text with any attribute field of the Data Driven Pages index layer. For example, if you have an attribute on the index layer named POPULATION, you can create a dynamic text tag using this field, &lt;BR /&gt;&lt;BR /&gt;&amp;lt;dyn type="page" property="POPULATION"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;to dynamically display the POPULATION values for each page in the layout.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;edit: I see now that you want hectares. You'll have to calculate a new field in your index layer for that.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 18:17:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamic-text/m-p/708370#M54906</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2012-05-03T18:17:27Z</dc:date>
    </item>
  </channel>
</rss>

