This tool has no parameters

7417
4
Jump to solution
11-27-2010 10:14 AM
denisedavis
Occasional Contributor III
I have been running through some code samples to try to discover an issue I'm having and I am having the same issue with the samples. I have been looking at this for 2 days now so it is most likely something I am just not seeing.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus
did you create a tool in arctoolbox which contains the 4 parameters as specified below
folderLocation = arcpy.GetParameterAsText(0)   # a folder which be required and an input parameter
layerFile = arcpy.GetParameterAsText(1)       # a layer which be required and an input parameter
dfName = arcpy.GetParameterAsText(2)        # a filename, required and input
position = arcpy.GetParameterAsText(3)       #a numeric value, index presumed to be short integer
or are you getting a specific error message?

View solution in original post

0 Kudos
4 Replies
DanPatterson_Retired
MVP Emeritus
did you create a tool in arctoolbox which contains the 4 parameters as specified below
folderLocation = arcpy.GetParameterAsText(0)   # a folder which be required and an input parameter
layerFile = arcpy.GetParameterAsText(1)       # a layer which be required and an input parameter
dfName = arcpy.GetParameterAsText(2)        # a filename, required and input
position = arcpy.GetParameterAsText(3)       #a numeric value, index presumed to be short integer
or are you getting a specific error message?
0 Kudos
denisedavis
Occasional Contributor III
No, I haven't. I'll look at that now. Thank you!
0 Kudos
CosminTana
New Contributor
Your probably solved the problem already, if not:

Line 30:
(folderLocation = arcpy.GetParameterAsText(0))
for what do you need this? at the moment you can delete it (except you want to do other stuff with it.)

In line 43:
arcpy.mapping.AddLayer(df, addLayer, position)

Instead of - position - use one of those :  "TOP", "BOTTOM" or "AUTO_ARRANGE"
and delete line 33 OR simply watch out to use one of those as Input for the parameter

If you delete line 30, rearrange the the parameter order YYY = arcpy.GetParamterAsText(X) in the right way.
0 Kudos
denisedavis
Occasional Contributor III
Thanks. I had to go in and set up the tool parameters in the properties of the script. That solved the problem.
0 Kudos