Geometry object stuff

Discussion created by GSCUser85 Champion on Feb 13, 2014
Latest reply on Mar 6, 2014 by flspat
I have used this stuff before but this afternoon (because of my fading brain) I got stuck again.
This page says that using point geometry objects, you can access the X,Y,Z like this:

for row in arcpy.da.SearchCursor(infc, ["OID@", "SHAPE@"]):
    # Print the current multipoint's ID
    print("Feature {0}:".format(row[0]))

    # For each point in the multipoint feature,
    #  print the x,y coordinates
    for pnt in row[1]:
        print("{0}, {1}".format(pnt.X, pnt.Y))

If you do this, all you get is this :
>>> geom1
<PointGeometry object at 0x128e50d0[0x128e51c0]>
>>> geom1.type
>>> geom1.X

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
AttributeError: 'PointGeometry' object has no attribute 'X'

This had me stuck for about an hour until, from somewhere in my aging cortex, I remembered you had to do this :

>>> geom1.type
>>> geom1.getPart().X
>>> geom1.getPart().Y
>>> geom1.getPart().Z

Oh, and if you try to iterate over a geometry object like in the help, that fails as well.

>>> for p in geom1:
 print p.getPart().X


Traceback (most recent call last):
  File "<pyshell#10>", line 1, in <module>
    for p in geom1:
TypeError: 'PointGeometry' object is not iterable

Dear esri, when is either the attributes of the geometry going to get fixed, or the help files when you want to actually do this stuff?