AnsweredAssumed Answered

Custom tool error

Question asked by sadanand_arc on May 23, 2016
Latest reply on May 24, 2016 by sadanand_arc

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:

Test.jpg

  

test1.jpg

Outcomes