In my script I intent to select by location some features(polygons) from feature class call "opt_area", then I want to select other features from the same feature class using Select by attribute, then copy the selected features to a new feature class, but is not working. What it does is copying the entire feature class, not the features selected by SelectByLocation and SelectByAttribute
try:
arcpy.MakeFeatureLayer_management(opt_areas, opt_areas_layer)
# Process: Selecting by Location; Use Selecting by Location to select features that are intersected by roads.
arcpy.SelectLayerByLocation_management(opt_areas_layer, "INTERSECT", roads, "", "NEW_SELECTION", "") print("Select by location completed")
# Process: Select by Attribute
arcpy.SelectLayerByAttribute_management(opt_areas_layer, "ADD_TO_SELECTION", where_clause="Shape_Area >= 40469")
print("Select by attribute completed")
except:
print(arcpy.GetMessages())