My script works fine with a single feature class selected for clip_fc = arcpy.GetParameter(0)
.
However when I set clip_fc to MultiValue in the script properties and then select several feature classes, I get an error "Parameters are not valid.".
Can anyone show me where I am going wrong?
import arcpy
import os.path
from arcpy import env
arcpy.env.workspace = r"C:\GIS Home\project_1\clipshps\Combined_mf.gdb"
arcpy.env.overwriteOutput = True
clip_fc = arcpy.GetParameter(0)
clip_name = str(clip_fc)
output_dir = r"C:\GIS Home\project_1\clipshps\outputs_clip"
for fds in arcpy.ListDatasets():
for fc in arcpy.ListFeatureClasses('','',fds):
out = os.path.join(output_dir, fc + "_" + clip_name[40:] + "_clip.shp")
arcpy.Clip_analysis(fc, clip_fc, out, "")