Output parameter in script tool doesn't work, why?

956
2
Jump to solution
02-26-2017 09:23 PM
babakkasraei
New Contributor II

Hi 

I try to specify an argument for output shape file to create it (outputShape = sys.argv[4])

and to get the shape file name from parameters. Then I set the output file parameter as a feature class and output. But my output parameter doesn't work. the script is as follows. 

Why Cannot I get the output name from parameters? 

Thanks

 -------------------------------------------------------------------------------------------------------------

# the path to workplace
arcpy.env.workspace = sys.argv[1]
# The path to the CSV file
inputCSVfile = sys.argv[2]
#Get the template shapefile
templateShapeFile = sys.argv[3]
# The name of the output shape file
outputShape = sys.argv[4]    <<<-------------------------------------------------- Here???? it doesn't work,Why???  

# open CSV file
inFile = open(inputCSVfile, "r")

# create feature class
arcpy.CreateFeatureclass_management(arcpy.env.workspace, outputShape, "POINT", templateShapeFile, "DISABLED", "DISABLED", templateShapeFile)

---------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------

0 Kudos
1 Solution

Accepted Solutions
FC_Basson
MVP Regular Contributor

The second parameter of the arcpy.CreateFeatureclass_management function should be a string and not a Feature Class

View solution in original post

2 Replies
FC_Basson
MVP Regular Contributor

The second parameter of the arcpy.CreateFeatureclass_management function should be a string and not a Feature Class

View solution in original post

babakkasraei
New Contributor II

Great help, Thank you 

I changed the parameter value to string and it worked. 

Best 

0 Kudos