AddGeometryAttributes_management failing to execute

Discussion created by atvanwie on Jun 12, 2019
Latest reply on Apr 18, 2020 by atvanwie

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.

arcpy.AddGeometryAttributes_management("layername", "AREA", Area_Unit="SQUARE_KILOMETERS") 

Traceback (most recent call last):

  File "c:\program files (x86)\arcgis\desktop10.6\ArcToolbox\Scripts\", line 292, in <module>

    AddGeometryAttributes(fc, geomProperties, lUnit, aUnit, cs)

  File "c:\program files (x86)\arcgis\desktop10.6\ArcToolbox\Scripts\", line 49, in AddGeometryAttributes

    fields = CreateOutputFields(fc, geomProperties, hasZ, hasM)

  File "c:\program files (x86)\arcgis\desktop10.6\ArcToolbox\Scripts\", line 232, in CreateOutputFields

    currentFields = [ for field in arcpy.ListFields(fc)]

TypeError: 'geoprocessing list object' object is not iterable


Failed to execute (AddGeometryAttributes).

Any ideas?