Select to view content in your preferred language

GPK Parameters for Python Script Tool

2308
3
07-31-2012 02:30 PM
Labels (1)
MatthewBrown1
Deactivated User
Hi,

I have a Python script tool with Feature Set input parameters that are converted to GPString when packaged as a GPK (this is what the REST API reports). The output feature layers are set to GPFeatureRecordSetLayer, and I would expect the inputs to be the same base on the docs and samples.

Also, if I look at the JSON version, there are choiceList and defaultValue parameters, which aren't configured in my script or in the tool. (But probably come from my execution of the tool in ArcMap.)

So when I execute the GPK from the Runtime, I get:


[INDENT]Error 000735: ...Value is required (repeated for each input)
[/INDENT]


and


[INDENT]Error 000800: The value is not a member of..... (values from the choiceList)
[/INDENT]


Are there extra steps required to prepare a Python script tool that I have missed?

Many thanks,

Matt
0 Kudos
3 Replies
MatthewBrown1
Deactivated User
I should add that a model of the same workflow works for me if I use the in-memory templates to draw some features.
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

It sounds like the parameters may not be set up correctly when you added/imported the Python script into a toolbox in ArcMap. When adding a script to a toolbox the third screen of the wizard/dialog lets you define the parameters in terms of data type and input/output direction. You can access the same dialog after the script has been imported by right clicking the script within the toolbox then selecting Properties.

There's some doc which covers this in the desktop help: http://resources.arcgis.com/en/help/main/10.1/index.html#//00150000000n000000.

Cheers

Mike
0 Kudos
MatthewBrown1
Deactivated User
Hi Mike,

Turns out that I had set the parameters correctly in the tool properties. However, when I ran the tool in ArcMap I used existing feature classes in the MXD to make sure the results were valid, when I packaged this result, the input parameters somehow changed to GPString. Perhaps this can be captured in the Analyze step?

Thanks,

Matt
0 Kudos