[GIS] Add Geometry attributes error

arcgis-desktoparcmaparcpy

I have a point shapefile on which I would like to use the "Add geometry attributes: tool in order to add x and y coordinates using a GCS that I am interested it. When I run this tool I get the runtime error:

"The field is not nullable (Point_M)".

I don't understand why I am getting this error. AddGeometryAttributes is supposed to add this field on its own, I have no role in the field Point_M. In fact it doesn't even exist before I run the tool. This is one of the outputs of AddGeometryAttributes.

Has anyone had this problem before?

Best Answer

@Michael is probably be right. Your point feature class has M-values enabled, but you haven't set the M-value for each point. In fact, if you're not using the feature class for routing or reckoning distances (like mileposts), you don't need M-values enabled.

An alternative to using the "Add Geometry" tool is to make two new fields called "X" and "Y" and Field Calculate them using the Python syntax: !SHAPE.firstPoint.X! and !SHAPE.firstPoint.Y!, assuming there are no multi-part features.

Calculate Coordinate XY Example