I'm trying to write a script using 'Select by Attribute' in ArcMAP. What I want to do is create a for loop that will pass a value to the Select by Attribute expression. I was thinking something along the lines of: (x=number of polygons in a shapefile)
for j in range(0,x,1):
arcpy.MakeFeatureLayer_management ("layer", "temp")
arcpy.SelectLayerByAttribute_management ("temp","NEW_SELECTION",""" "ID" > j""")
arcpy.CopyFeatures_management("temp","SlopeG5")
The rest of the scripting I should be able to handle, but when I run this, I get error code 000358, saying that the expression isn't valid. ArcMap doesn't appear to like the 'j' within the select by attributes.
The overall goal is to isolate a polygon, use a select by location to find polygons intersecting, find the area of the two, and divide to get the percentage of the main polygon covered by the second.
Hopefully this description is clear enough to get some help