What I want from python script, searching a workspace containing Geodatabases and feature classes(Iterate Feature Classes), then clip those by interested Area (polygon). the resulted clipped files most not empty. I tried to convert Model builder to Python script and added "If" condition to transfer not empty features to final geodatabase:
import arcpy from arcpy import env #script arguments env.workspace=arcpy.GetParameterASText(0) clip_Features = arcpy.GetParameterASText(1) FeatureClass_clip = arcpy.GetParameterASText(2) #Local variables: Recursive = "true" Name = "FeatureClass" Feature_Class = "\\FeatureClass" FeatureClass_Clip__2_= FeatureClass_clip FeatureClass = arcpy.ListFeatueClasses("*") #Process : Clip arcpy.Clip_analysis(FeatureClass, Clip_Features, FeatureClass_Clip, "") #Process: Delet Features for fc in FeatureClass_Clip: Count1=str(arcpy.Getcount_managment(fc)) if count1 <> "0": arcpy.FeatureClassToGeodatabase_conversion(FeatureClass_Clip, "")
I imported the script to toolbox and defined parameters, but script not ran because of clip raise error.