Hi All
I am getting error when running custom created script tool to copy feature classes from folder to geodatabase
below is the error
Traceback (most recent call last): File "D:\Python DVD\Python\Data\Exercise02\CopyFeature.py", line 9, in <module> arcpy.CopyFeatures_management(fc, os.path.join(outgdb, fcdesc.basename)) File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 2429, in CopyFeatures raise e ExecuteError: ERROR 000210: Cannot create output E:\ArcPy\ResultFeatures\basin Failed to execute (CopyFeatures). Failed to execute (MyCopy).
What am i missing, Please help me
and the script? the details are within
It doesn't look as if there is a geodatabase in your output file path, based on the error you are receiving.
From what I can see Benjamin hit the nail on the head. Workspaces can be folders or geodatabases.
Your second tool parameter should be an existing geodatabase, that is "E:\ArcPy\ResultFeatures\Test1.gdb" (instead of a folder: "E:\ArcPy\ResultFeatures").
You can set the parameter Filter property to exclude folders - this will prevent you from providing a folder name for the second argument by mistake. Also -- make sure this parameter is of type Input to make sure you provide the path to an existing geodatabase.
Thank you so much for your HELP
Hi Sadanandachar,
Can you post the script?
Hi below is my script created for custom tool
import arcpy import os from arcpy import env env.workspace = arcpy.GetParameterAsText(0) outgdb = arcpy.GetParameterAsText(1) fclist = arcpy.ListFeatureClasses() for fc in fclist: fcdesc = arcpy.Describe(fc) arcpy.CopyFeatures_management(fc, os.path.join(outgdb, fcdesc.basename))
You should keep these links handy
What is ArcPy?—Help | ArcGIS for Desktop
ArcInfo Workstation Item properties—Help | ArcGIS for Desktop
Describe object properties—Help | ArcGIS for Desktop
and particularly
env—Help | ArcGIS for Desktop with the overwriteOutput option. Sometime a 'can't create... means that it already exists and can't be overwriten since env.overwriteOutput = True needs to be set
Oooh, that's a good one. Forgot about:
env.overwriteOutput = True
That may be the issue here.
Thank you very much