I'm trying to write a program that clips all the features in a workspace. I've read through several similar threads on this website, but still am having trouble understanding what is wrong with my program.
# This program clips all roads, state roads, railroads, steams, rivers, and # land use using the Meridian Township boundary. Each clipped dataset is # renamed to the base name plus "_Meridian.shp" import arcpy arcpy.env.workspace = "F:/data" clipFeature = 'Meridian.shp' appendstring = '_Meridian' featureClassList = arcpy.ListFeatureClasses() # this gets the base name variable clipFeatureName = arcpy.Describe(clipFeature) clipName = str(clipFeatureName.baseName) try: for featureClass in featureClassList: featureClassDescription = arcpy.Describe(featureClass) featureClassList = arcpy.ListFeatureClasses() #this gets the base name variable nameString = str(featureClassDescription.baseName) arcpy.Clip_analysis(featureClassList, clipFeature, "F:/output") # this statement prevents the clip feature from clipping itself. if nameString == clipName: pass else: namething = nameString + appendstring print namething except: print arcpy.GetMessages(2)
Update: My program does not produce an error message, but when I look in my output folder in arccatalog, it is empty.