Select by Layer using a List then CopyFeatures to new .shp

Discussion created by AROACH220 on Dec 14, 2011
I want use the list of feature classes I created to perform multiple SelectByLayer functions and then Copy the selected features to a new file.

I used MakeFeatureLayer to convert the input layer

however, for the "overlay" layer I am confused on how to make that dynamic with changing featureclass from the list

Then when it comes to naming the new layers I want to use the name of the overlay layer + "sometext" and save it to a gdb.

This is where I am and I am thinking that it is not iterating through the list like I want it to.

for popList in arcpy.ListFeatureClasses():


        arcpy.MakeFeatureLayer_management('E:/Project/Project.gdb/POIs', 'POIs_lyr')

        arcpy.SelectLayerByLocation_management("POIs_lyr", "INTERSECT", popList, "", "NEW_SELECTION")

        arcpy.CopyFeatures_management("POIs_lyr", "E:/Project/Explore/" + "popList.txt" + "POIs.shp")