myFC = r"C:\temp\test.shp" oidFieldName = gp.describe(myFC).oidfieldname searchRows = gp.searchcursor(myFC) searchRow = searchRows.next() while searchRow: oidFieldValue = searchRow.getvalue(oidFieldName) outputFC = r"C:\temp\output_" + str(oidFieldValue) + ".shp" gp.Select(myFC, outputFC, oidFieldName + " = " + str(oidFieldValue) searchRow = searchRows.next()
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.