Select to view content in your preferred language

Error calculating central point coordinates

690
1
10-05-2020 05:46 PM
Felicitychun
Occasional Contributor

I am having issues running the central point geometry attributes calculation. I do the centroid calculation and it works perfectly fine in the same way. Any idea with this problem?

Traceback (most recent call last):
File "C:\Program Files\ArcGIS\Pro\Resources\ArcToolBox\Scripts\AddGeometryAttributes.py", line 396, in <module>
addGeomAtts.execute()
File "C:\Program Files\ArcGIS\Pro\Resources\ArcToolBox\Scripts\AddGeometryAttributes.py", line 85, in execute
row = self.ShapeCalc(row, geom, geomProperties)
File "C:\Program Files\ArcGIS\Pro\Resources\ArcToolBox\Scripts\AddGeometryAttributes.py", line 173, in ShapeCalc
row = self.Update(row, "INSIDE_X", geom.centroid.X)
File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\arcobjects\_base.py", line 90, in _get
return convertArcObjectToPythonObject(getattr(self._arc_object, attr_name))
SystemError: <built-in function getattr> returned NULL without setting an error
Failed to execute (Add Geometry Attributes).
Failed to execute (Model).

0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

To be sure, run a Check Geometry, and if necessary a Repair Geometry on the data.

It may be useful to run a MultiPartToSinglePart tool is case you have multipart shapes and it is causing the issue.


... sort of retired...