haasel

I can't read shape points in py script, getPart() doesn't work

Discussion created by haasel on May 24, 2011
Latest reply on May 25, 2011 by haasel
Hi!

I've got layer of polygons and I'm trying to read with py script all shapes.
But for almost all shapes I can't read their geometries (getPart() returns nothing - I've checked partCount returns 0, but pointCount nonzero values)
Of course all objects are displayed well in ArcEditor

I use code similar to:

import arcpy

# Identify the geometry field
#
desc = arcpy.Describe("myLayer")
shapefieldname = desc.ShapeFieldName

# Create search cursor
#
rows = arcpy.SearchCursor(infc)

# Enter for loop for each feature/row
#
for row in rows:
    # Create the geometry object 'feat'
    #
    feat = row.getValue(shapefieldname)
    pnt = feat.getPart()

    # Print x,y coordinates of current point
    #
    print pnt.X, pnt.Y

What is going on?
Any idea?

Piotr

Outcomes