I am puzzled by a simple problem. I don't know how to access a point object's x and y coordinate from a arctoolbox in python script.
It can be accessed this way:
pnt=arcpy.GetParameterAsText(0).split() # c1 is a point object in arctoolbox interface
It's not ideal because the code will fail when the x and y are inputed in different decimal seperator, say ',' format.
So I use:
But what's the method to get pnt.X and pnt.Y?
Have a look at this help description: http://pro.arcgis.com/en/pro-app/arcpy/classes/point.htm
Then to read the geometry:
point = arcpy.GetParameter(0) ptGeometry = arcpy.PointGeometry(point) x = ptGeometry.X y = ptGeometry.Y
Thank you Basson. Line 2 return: RuntimeError: Object: CreateObject cannot create geometry from inputs.
arcpy.AddMessage(type(point)) show: <type 'geoprocessing value object'>
So your issue is with the regional settings of the OS for decimal number notation. You can detect what format the user's OS is showing floats with