Hi All
As suggestions given in the blog i modified the script, But still i am getting the same error please help me
when i run the script in python editor with workspaces hardcoded like below, the code executes properly.
import arcpy
... import os
... from arcpy import env
... env.overwriteOutput = True
... env.workspace = "D:/Python DVD/Python/Data/Exercise02"
... outgdb = "D:/Data/Test1.gdb"
... print outgdb
... fclist = arcpy.ListFeatureClasses()
... for fc in fclist:
... fcdesc = arcpy.Describe(fc)
print fcdesc.baseName
print os.path.join(outgdb, fcdesc.baseName)
... arcpy.CopyFeatures_management(fc, os.path.join(outgdb, fcdesc.baseName))
But when i create custom tool using this script i am getting the error
import arcpy
import os
from arcpy import env
env.overwriteOutput = True
env.workspace = arcpy.GetParameterAsText(0)
outgdb = arcpy.GetParameterAsText(1)
print outgdb
fclist = arcpy.ListFeatureClasses()
for fc in fclist:
fcdesc = arcpy.Describe(fc)
print fcdesc.baseName
print os.path.join(outgdb, fcdesc.baseName)
arcpy.CopyFeatures_management(fc, os.path.join(outgdb, fcdesc.baseName))
Error is:
Ensure that your Geoprocessing environment is configured to allow output overwrite
Thank you very very much
This thread is in essence a duplicate of this thread Error when running custom script tool
and overwriteoutputs was suggested as well.
Respond to the suggestions in one thread as to whether they worked or not before starting a duplicate.
Could you provide more print statements in your code so people can accurately assess what your inputs and outputs are.