I am at my wits end on this. I'm using Arc10. Trying to write a script that will loop through a list of feature classes (some shapefiles, some sde files). Eventually I want to add a parameter for the user to input a selection layer, and then have it "select by location" on each feature class and then copy the results to a new layer or shapefile. I've got it mostly to work, however I keep getting an error message when I try to define the output feature class. Relevant portions of the script posted below:
#Create a list of cliplayers
#
fcList = [lynxpts, wbc, etsc, svp, Ehplvtrn, Ehrtrn, shbird, iwwh, dwa, lurcdwa, sni, twwh]
#For each layer in the list of cliplayers, select by location according to the input layer
#If selection is empty, print a message. If not, copy features to a new layer in the output directory
#
for fc in fcList:
desc = arcpy.Describe(fc)
if desc.extension == "shp":
lyr = arcpy.MakeFeatureLayer_management(fc, desc.basename + "_lyr")
arcpy.SelectLayerByLocation_management(lyr, "INTERSECT", selectlyr, "", "NEW_SELECTION")
count = arcpy.GetCount_management(lyr)
if count == 0:
print "The Selection is empty for " + lyr
else:
outFC = os.path.join(outpath, lyr)
arcpy.CopyFeatures_management(lyr, outFC)
print "Output Feature Class is: " + outputFC
else:
The error message in the interactive window is the following:
AttributeError: ResultObject: Error in parsing arguments GetOutput
The error message is referring to the red highlighted line. I don't understand why this isn't working!
Thank you in advance for any help!
Amy Meehan
Wildlife Biologist
MDIFW
Bangor, Maine