# Create search cursor for feature class. rows = gp.SearchCursor("Stewardship") row = rows.Next() while row: # Get the ID value desc = arcpy.Describe("Stewardship") OIDFieldName = desc.OIDFieldName id = row.GetValue(OIDFieldName) arcpy.AddMessage(id) row = rows.next()
desc = arcpy.Describe("Stewardship") OIDFieldName = desc.OIDFieldName
fc = r"C:\csny490\overlay_20130620\gis_layers\county.gdb\county" arcpy.MakeFeatureLayer_management(fc, "fl") arcpy.SelectLayerByAttribute_management("fl", "NEW_SELECTION", "COUNTY_CD > 10") oidList = [int(oid) for oid in arcpy.Describe("fl").FIDSet.split(";")]
fc = r"C:\csny490\overlay_20130620\gis_layers\county.gdb\county" arcpy.MakeFeatureLayer_management(fc, "fl", "COUNTY_CD > 10") oidList = [oid[0] for oid in arcpy.da.SearchCursor("fl",["OID@"])]
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.