for row in sCur: geom = row.shape ext = geom.extent
arcpy.Describe("Layer").extent.xmin
row.getValue(field)
row.field
row.shape.length
There are two basic ways to get and set field values on a row:Using the field name, as in value = row.road_typeUsing getValue and setValue, as in value = row.getValue("road_type")
Thanks for the pointer, but I cannot find any reference to .shape on the page you linked. There is no property of the Geometry class called 'shape'. So, as far as I can see, my original question stands: where is .shape documented?Why does the following work, when the Row class doesn't even have a property called 'shape'? And why is there no object model diagram? It's so difficult to see how classes interact when you have to hop from one help entry to the other. We need a diagram to see how they fit together!>>> cur = arcpy.SearchCursor("Landscan_Sample") >>> for row in cur: ... print row.shape.extent.XMax ... -10.8041666667 -10.7958333333 -10.7875
>>> cur = arcpy.SearchCursor("Landscan_Sample") >>> for row in cur: ... print row.shape.extent.XMax ... -10.8041666667 -10.7958333333 -10.7875
geom = row.getValue('Shape')
It is part of the geometry object and is definitely documented.http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000070000000
arcpy.Describe("Layer").extent.XMin
searchRows = arcpy.da.SearchCursor("layer",["OID@","SHAPE@"]) for searchRow in searchRows: oidValue = searchRow[0] xminExt = searchRow[1].extent.XMin print "OID = " + str(oidValue) + " has an xmin extent of " + str(xminExt)
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.