<?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: AddGeometryAttributes_management failing to execute in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/addgeometryattributes-management-failing-to/m-p/826290#M3026</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sharing with &lt;A href="https://community.esri.com/space/2145"&gt;Python&lt;/A&gt;‌ since this is an ArcPy question and not ArcGIS API for Python question.&amp;nbsp; Also, &lt;A href="https://community.esri.com/migrated-users/61619"&gt;Andrew VanWie&lt;/A&gt;‌, please change this to a question instead of a discussion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Jun 2019 21:28:48 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2019-06-12T21:28:48Z</dc:date>
    <item>
      <title>AddGeometryAttributes_management failing to execute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/addgeometryattributes-management-failing-to/m-p/826289#M3025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having a problem where I'm trying to calculate area of geometry but it is failing in my Python script. Using ArcGIS 10.6.1.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.AddGeometryAttributes_management("&lt;EM&gt;layername&lt;/EM&gt;", "AREA", Area_Unit="SQUARE_KILOMETERS")&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-size: 10.0pt; color: #e60000;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10.0pt; color: #e60000;"&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.6\ArcToolbox\Scripts\AddGeometryAttributes.py", line 292, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10.0pt; color: #e60000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddGeometryAttributes(fc, geomProperties, lUnit, aUnit, cs)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10.0pt; color: #e60000;"&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.6\ArcToolbox\Scripts\AddGeometryAttributes.py", line 49, in AddGeometryAttributes&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10.0pt; color: #e60000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fields = CreateOutputFields(fc, geomProperties, hasZ, hasM)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10.0pt; color: #e60000;"&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.6\ArcToolbox\Scripts\AddGeometryAttributes.py", line 232, in CreateOutputFields&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10.0pt; color: #e60000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; currentFields = [field.name for field in arcpy.ListFields(fc)]&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10.0pt; color: #e60000;"&gt;TypeError: 'geoprocessing list object' object is not iterable&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10.0pt; color: #e60000;"&gt;&amp;nbsp;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 10.0pt; color: #e60000;"&gt;Failed to execute (AddGeometryAttributes).&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Any ideas?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:56:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/addgeometryattributes-management-failing-to/m-p/826289#M3025</guid>
      <dc:creator>AndrewVanWie</dc:creator>
      <dc:date>2021-12-12T09:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: AddGeometryAttributes_management failing to execute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/addgeometryattributes-management-failing-to/m-p/826290#M3026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sharing with &lt;A href="https://community.esri.com/space/2145"&gt;Python&lt;/A&gt;‌ since this is an ArcPy question and not ArcGIS API for Python question.&amp;nbsp; Also, &lt;A href="https://community.esri.com/migrated-users/61619"&gt;Andrew VanWie&lt;/A&gt;‌, please change this to a question instead of a discussion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2019 21:28:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/addgeometryattributes-management-failing-to/m-p/826290#M3026</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-06-12T21:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: AddGeometryAttributes_management failing to execute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/addgeometryattributes-management-failing-to/m-p/826291#M3027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you share a bit more of your script&amp;nbsp;- specifically, where the layer name is being set?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2019 18:37:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/addgeometryattributes-management-failing-to/m-p/826291#M3027</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2019-06-14T18:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: AddGeometryAttributes_management failing to execute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/addgeometryattributes-management-failing-to/m-p/826292#M3028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pardon my newbie-ness with Python. Hope this makes sense. Not sure how to change my post from Discussion to Question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 8 workstations and users running ArcGIS 10.6. I get the error on only 2 workstations, it works well on the other 6, so that is my confusion. The workstations should be set up identically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After selecting a feature from the "blocks" layer in ArcMap, I run an executable script in the ArcMap Python window that requires parameters for "blockname" and "point density" to scatter random points in polygons at specified density:&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import sys
sys.argv = ["&lt;EM&gt;path_to_script.py&lt;/EM&gt;", "NXXWXXX", "####"]
execfile( "&lt;EM&gt;path_to_script.py&lt;/EM&gt;" )&lt;/PRE&gt;&lt;P&gt;Then, in my main script "&lt;EM&gt;path_to_script.py&lt;/EM&gt;" I set the layername with sys.argv[1] and sys.argv[2]. Processing is done from source data paths for imagery and features, running arcpy scripts. All layer processing is&amp;nbsp;output to a temporary geodatabase workspace, which is removed at the end. I removed the remaining processing arcpy lines following &lt;STRONG&gt;arcpy.AddGeometryAttributes_management&lt;/STRONG&gt; for sake of space since this is where it fails. Everything works right up to it.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import tempfile
def main ( ):
&amp;nbsp;&amp;nbsp;&amp;nbsp;blockname = sys.argv[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;point_density = sys.argv[2]
&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.CreateFileGDB_management(tempfile.gettempdir(), blockname + "_" + point_density)
&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.CreateFeatureDataset_management(tempfile.gettempdir() + "/" + blockname + "_" + point_density + ".gdb", "dataset1", "WGS 1984 UTM Zone 17N.prj")
&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.env.workspace = tempfile.gettempdir() + "/" + blockname + "_" + point_density + ".gdb" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;try:
 &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.MakeFeatureLayer_management ("blocks", blockname + "_Layer")
 &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.Clip_management(polygon_features_path, "#", blockname + "_clip", blockname + "_Layer", "#", "ClippingGeometry")
 &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.Clip_analysis(feature_buffers_path, blockname + "_Layer", blockname + "_buffers")
 &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.RasterToPolygon_conversion(blockname + "_clip", "dataset1/" + blockname + "_rast2poly", "NO_SIMPLIFY")
 &amp;nbsp;&amp;nbsp;&amp;nbsp;qry = '"gridcode" &amp;gt; 35'
 &amp;nbsp;&amp;nbsp;&amp;nbsp;flayer = arcpy.MakeFeatureLayer_management (blockname + "_rast2poly", blockname + "_rast2poly2_Layer")
 &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.SelectLayerByAttribute_management (flayer, "NEW_SELECTION", qry)
 &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.CopyFeatures_management (flayer, "dataset1/" + blockname + "_export")
 &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.Dissolve_management (blockname + "_export", "dataset1/" + blockname + "_dissolve")
 &amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddGeometryAttributes_management(blockname + "_dissolve", "AREA", Area_Unit="SQUARE_KILOMETERS")
...
...
...
if __name__ == '__main__':
&amp;nbsp;&amp;nbsp;&amp;nbsp;main() &lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:56:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/addgeometryattributes-management-failing-to/m-p/826292#M3028</guid>
      <dc:creator>AndrewVanWie</dc:creator>
      <dc:date>2021-12-12T09:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: AddGeometryAttributes_management failing to execute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/addgeometryattributes-management-failing-to/m-p/826293#M3029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With only a quick look, I see you are sometimes using "dataset1/" + ... and sometimes not using it.&amp;nbsp; I wonder if the inconsistency is the issue.&amp;nbsp; You might try:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures_management &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;flayer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"dataset1/"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; blockname &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_export"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Dissolve_management &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"dataset1/"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; blockname &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_export"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"dataset1/"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; blockname &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_dissolve"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddGeometryAttributes_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"dataset1/"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; blockname &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_dissolve"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"AREA"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Area_Unit&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SQUARE_KILOMETERS"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:56:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/addgeometryattributes-management-failing-to/m-p/826293#M3029</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-12T09:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: AddGeometryAttributes_management failing to execute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/addgeometryattributes-management-failing-to/m-p/826294#M3030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Upgrading to ArcGIS Desktop 10.7.1 somehow fixed the issue on the 2 workstations that were affected. I'm not sure what was going on with 10.6.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Apr 2020 05:32:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/addgeometryattributes-management-failing-to/m-p/826294#M3030</guid>
      <dc:creator>AndrewVanWie</dc:creator>
      <dc:date>2020-04-19T05:32:03Z</dc:date>
    </item>
  </channel>
</rss>

