pink34

Select Layer By Attribute

Discussion created by pink34 on Feb 23, 2012
Latest reply on Feb 23, 2012 by curtvprice
In that code part, trying to remove the features whose stream level is greater than selected feature's stream level from the current selection. Is there any help about this?


for a in range(1,6):

obj = "ID_1=%d" % (a)


arcpy.SelectLayerByAttribute_management (fc1,"NEW_SELECTION",obj)

Selected StreamLevel is equal to 7 from the above line. For example: a=StreamLevel 

arcpy.SelectLayerByLocation_management(fc1,"INTERSECT",fc1)
arcpy.CopyFeatures_management(fc1,"hidden")

# How can I code: "StreamLevel>a" at the following line and remove the selected features whose stream level is greater than seven from the current selection 
arcpy.SelectLayerByAttribute_management(fc1,"REMOVE_FROM_SELECTION","StreamLevel>7")
arcpy.SelectLayerByAttribute_management (fc1,"CLEAR_SELECTION")

Outcomes