<?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: Is there a way in Model Builder to display a calculated amount on the map? in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765719#M749</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can&amp;nbsp;execute some Python code using the Calculate Value tool to&amp;nbsp;calculate a text string and locate (by name) and update a text element on the map layout.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/introduction-to-arcpy-mapping.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/introduction-to-arcpy-mapping.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Introduction to arcpy.mapping—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/textelement-class.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/textelement-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;TextElement—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Untested code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# calculate value expression (uses Get Count results from model)&lt;/SPAN&gt;
update&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%GetCount Output%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%Total Records%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# code block - text box in map is named CountMessage&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;update&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;count&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; tot&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  mxd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CURRENT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  tbox &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListLayoutElements&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"TEXT_ELEMENT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"CountMessage"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
  pct &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;100&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; float&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;count&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; float&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tot&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  tbox&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Area: {}%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pct&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RefreshActiveView&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; mxd‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 08:30:45 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2021-12-12T08:30:45Z</dc:date>
    <item>
      <title>Is there a way in Model Builder to display a calculated amount on the map?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765715#M745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In Model Builder I create a layer that has values for each record, I want to calculate the % of records that are above a certain value and display that amount on the box with a message like "Areas covered: X%" where X is the calculated value. I've been looking around and have not seen anything on how to do this but there must be a way?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2019 12:48:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765715#M745</guid>
      <dc:creator>AliceAnderson</dc:creator>
      <dc:date>2019-02-15T12:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way in Model Builder to display a calculated amount on the map?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765716#M746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have never done it ... but this looks promising:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create a custom python script to run within model builder that will display a message box and send the into to the message box function to display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://resources.arcgis.com/en/help/main/10.2/index.html#/The_pythonaddins_module/014p00000021000000/" title="http://resources.arcgis.com/en/help/main/10.2/index.html#/The_pythonaddins_module/014p00000021000000/"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2019 15:35:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765716#M746</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2019-02-15T15:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way in Model Builder to display a calculated amount on the map?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765717#M747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would say although you might be able to do what&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/5768"&gt;Ted Kowal&lt;/A&gt; has suggested, do you actually want to do that? &lt;EM&gt;Think about it&lt;/EM&gt; no geoprocessing tool does what you are asking. It would essentially lock the model as it halts to display a dialog box. This would break the design philosophy of models in that they can be used and embedded within other models. If you had a model that was firing off an event to display in a dialog box that would just bring things to a grinding halt....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think a far better and sensible approach is to turn your logic into a python tool as Ted says but write the final message to the standard message box which captures and displays all output of geoprocessing tools. If you tend to run tools in the background you won't see this and would need to go to the results pane to see the messages, or just turn off background processing.&lt;/P&gt;&lt;P&gt;In python to write a message to the results dialog box you would use arcpy.AddMessage("Hello World!"), explore the help file and look into how to turn a script into a &lt;EM&gt;script tool&lt;/EM&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2019 10:19:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765717#M747</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2019-02-18T10:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way in Model Builder to display a calculated amount on the map?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765718#M748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with&lt;SPAN style="background-color: #ffffff; color: #8b8b8b; font-size: 20.576px; "&gt;&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/12371"&gt;Duncan Hornby&lt;/A&gt;‌&lt;/SPAN&gt;&amp;nbsp;... just because you can does not mean it is the right thing to do.....&amp;nbsp; If I need to acquire user input or notifications that require action I generally use arcObject programming where I can control when geoprocessing starts or stops.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2019 15:26:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765718#M748</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2019-02-19T15:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way in Model Builder to display a calculated amount on the map?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765719#M749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can&amp;nbsp;execute some Python code using the Calculate Value tool to&amp;nbsp;calculate a text string and locate (by name) and update a text element on the map layout.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/introduction-to-arcpy-mapping.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/introduction-to-arcpy-mapping.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Introduction to arcpy.mapping—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/textelement-class.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/textelement-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;TextElement—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Untested code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# calculate value expression (uses Get Count results from model)&lt;/SPAN&gt;
update&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%GetCount Output%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%Total Records%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# code block - text box in map is named CountMessage&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;update&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;count&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; tot&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  mxd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CURRENT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  tbox &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListLayoutElements&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"TEXT_ELEMENT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"CountMessage"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
  pct &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;100&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; float&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;count&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; float&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tot&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  tbox&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;text &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Area: {}%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pct&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RefreshActiveView&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; mxd‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:30:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765719#M749</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-12T08:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way in Model Builder to display a calculated amount on the map?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765720#M750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's cool, I didn't know you could do that! I'm making a simple model for non-GIS people to run, and now they can have a quick report to print!&lt;/P&gt;&lt;P&gt;FYI to anyone using the code, you need to change it to:&lt;/P&gt;&lt;P&gt;def update(count&lt;STRONG&gt;, tot&lt;/STRONG&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2020 14:18:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765720#M750</guid>
      <dc:creator>ChelseaRozek</dc:creator>
      <dc:date>2020-06-16T14:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way in Model Builder to display a calculated amount on the map?</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765721#M751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.esri.com/migrated-users/167433"&gt;Chelsea Rozek&lt;/A&gt;‌ - fixed it!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jun 2020 19:39:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/is-there-a-way-in-model-builder-to-display-a/m-p/765721#M751</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2020-06-17T19:39:21Z</dc:date>
    </item>
  </channel>
</rss>

