<?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: Modelbuilder Questions: Calculate Field/Add Field Automation in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821328#M3473</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the responses Darren and Wes!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was afraid this was the case but I figured it was worth asking regardless. Can either of you suggest a good resources for learning Python scripting? I have some experience but that was a few years ago so I'm basically starting from scratch with this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Jun 2015 18:18:48 GMT</pubDate>
    <dc:creator>ColeRoberts</dc:creator>
    <dc:date>2015-06-02T18:18:48Z</dc:date>
    <item>
      <title>Modelbuilder Questions: Calculate Field/Add Field Automation</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821324#M3469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all! I've attached a screenshot of my working model. I'm hoping that I'm not way off on this one but I know for sure that a few sections need to be cleaned up or automated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Model Overview.PNG" class="image-1 jive-image" src="/legacyfs/online/105761_Model Overview.PNG" style="width: 620px; height: 398px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Essentially what I am trying to do is:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a grid over a specified geometry that captures demographic information like total population and density. &lt;STRONG&gt;Grids&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Calculate means and standard deviation for each demographic variable for use later. &lt;STRONG&gt;Summary Statistics&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="line-height: 1.5;"&gt;Calculate the geometric center of the grids and convert the grid to points. &lt;STRONG&gt;Calculate Field/&lt;/STRONG&gt;&lt;STRONG&gt;Make XY Event Layer&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="line-height: 1.5;"&gt;Add standardization fields for each variable and a zscore field. &lt;STRONG&gt;Add Field&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="line-height: 1.5;"&gt;Use means and standard deviations to calculate standardization for each point and ultimately a Zscore. &lt;STRONG&gt;Calculate Field&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="line-height: 1.5;"&gt;Use the Zscore to create a hotspot raster. &lt;STRONG&gt;IDW&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Here are my questions:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="line-height: 1.5;"&gt;How can I use multiple summary statistics as variables in the calculate field tool (sometimes up to 30 variables)?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="line-height: 1.5;"&gt;Sometimes only 1 variable will be used when creating a grid but other times 30+ variables will be used. Is there a simple way to add the same number of columns with the Add Field tool as variables specified in the Grid tool?&lt;/SPAN&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="line-height: 1.5;"&gt;As an example: I've specified population, household income and median age as my 3 variables. I'll need to add an extra standardization column for each and a zscore column. Is there any easier way than copying/pasting the Add Field tool 3 times?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="line-height: 1.5;"&gt;Same question about automation goes for calculating the mean/sd and calculating &lt;/SPAN&gt;standardization&lt;SPAN style="line-height: 1.5;"&gt; scores and Zscores for each. Iterator?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Any help is greatly &lt;/SPAN&gt;appreciated&lt;SPAN style="line-height: 1.5;"&gt;! If any of this is not clear do not hesitate to ask for clarification. I know this is rather complicated to explain but my main issue is how to utilize multiple summary statistic variables to calculate standardization scores and automate field adding/calculating. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2015 22:57:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821324#M3469</guid>
      <dc:creator>ColeRoberts</dc:creator>
      <dc:date>2015-06-01T22:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder Questions: Calculate Field/Add Field Automation</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821325#M3470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have moved this to the Modelbuilder place to get a targeted audience.&amp;nbsp; Geonet Help is for help on using GeoNet&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2015 01:35:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821325#M3470</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-06-02T01:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder Questions: Calculate Field/Add Field Automation</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821326#M3471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you've found yourself at the point where abandoning ModelBuilder and learning Python will greatly benefit your workflow, if this is possible in ModelBuilder at all (in fact, it may benefit all future workflows, too). Since you already have a mostly functional model, you can get a head start by &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//002w00000031000000" rel="nofollow noopener noreferrer" target="_blank"&gt;exporting your model to a Python script&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Learning Python is a bit of a steep curve, although not as bad as some languages, so you will have to do some work on your own.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a start, you will likely begin with a list of input layers, whether hard-coded or used as a script tool parameter. From that list, you get the number of items in the list or iterate through each item in the list (for example, you could add/calculate a field each time through the loop):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; masterFC = "points"
... fcs = ["First_Lyr","Second_Lyr","Third_Lyr"]
... print len(fcs)
... for fc in fcs:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print fc
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(masterFC,fc,"TEXT","","",20)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management(masterFC,fc,"\"" + fc + "\"")
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
3
First_Lyr
Second_Lyr
Third_Lyr&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:45:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821326#M3471</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-12T09:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder Questions: Calculate Field/Add Field Automation</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821327#M3472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like &lt;A _jive_internal="true" href="https://community.esri.com/people/dkwiens"&gt;Darren Wiens &lt;/A&gt;says you are at a spot where you would need to move to code to get where you want to go. I would just like to add to what he said with, if this is your first time working with code break it into small pieces. This will make it easier to understand what is happening and helps you keep track of what's working and what's not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2015 18:04:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821327#M3472</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-06-02T18:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder Questions: Calculate Field/Add Field Automation</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821328#M3473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the responses Darren and Wes!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was afraid this was the case but I figured it was worth asking regardless. Can either of you suggest a good resources for learning Python scripting? I have some experience but that was a few years ago so I'm basically starting from scratch with this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2015 18:18:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821328#M3473</guid>
      <dc:creator>ColeRoberts</dc:creator>
      <dc:date>2015-06-02T18:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder Questions: Calculate Field/Add Field Automation</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821329#M3474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's no concensus for best way to learn Python, but here are the GeoNet search results - you'll have to find what works best for you (book, online, etc.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="/t5/forums/searchpage/tab/message?q=learning python"&gt;https://community.esri.com/search.jspa?q=learning+python&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2015 18:33:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821329#M3474</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-06-02T18:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder Questions: Calculate Field/Add Field Automation</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821330#M3475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cole... Modelbuilder works well ... until one starts editing the model and moving things around on screen.&amp;nbsp; Even though the 'picture' looks good, if you examine the order of your processes when editing the model, you will often find things get out of order, so everything is nicely coloured and linked, until you try to run it again.&amp;nbsp; I have recommended in the past (see examples on my blog) of using the Results window to begin learning how to construct scripts that work.&amp;nbsp; If you can run a tool from arctoolbox for anything, and it works, go to the results window and see the process and export it to a python snippet.&amp;nbsp; You will soon see how to translate "I know how to do it in ArcToolbox" to creating your own script.&amp;nbsp; Good luck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2015 19:34:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821330#M3475</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-06-02T19:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder Questions: Calculate Field/Add Field Automation</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821331#M3476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The best thing about python is the command line.&amp;nbsp; Often times I get stuck on a piece of code that doesn't work, so I load a variable in the command line, and try my code out on that variable to see the results then fix it in my script.&amp;nbsp; Very handy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2015 19:43:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821331#M3476</guid>
      <dc:creator>JeffWard</dc:creator>
      <dc:date>2015-06-02T19:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Modelbuilder Questions: Calculate Field/Add Field Automation</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821332#M3477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One excellent book is published by ESRI, called "Python Scripting for ArcGIS," by Paul Zandberger, ISBN 978-158948-282-1 (first ed. 2013).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheerio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2015 20:33:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/modelbuilder-questions-calculate-field-add-field/m-p/821332#M3477</guid>
      <dc:creator>RobinWhite</dc:creator>
      <dc:date>2015-06-02T20:33:57Z</dc:date>
    </item>
  </channel>
</rss>

