Python Script Tool Validation Parameters

563
1
07-09-2012 08:55 AM
ChrisBates1
New Contributor
Hi Everyone.

I'm fairly new to python/ArcGIS script tools, so I was hoping I could find an easy/ straightforward example...
I need the user of tool to select an input parameter in a script tool from Dropdown List populated with 5 or 6 default string values.

I'm sure this is a very simple task, but I can't seem to find any straight forward examples online or in esri help that are this simple.

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00150000000t000000.htm

I know that this has to be set in the tool Properties > Validation > Edit the Validation Script.

Anybody have any insight on how I should write the function so that I get a very simple list of strings to choose from?

Thanks!

Chris
Tags (2)
0 Kudos
1 Reply
KevinHibma
Esri Regular Contributor
If its a hardcoded list that doesn't need to change based on other parameters, you dont need to use the Validator.

On the Parameters tab of your script tool, add a new input of type string.
For its properties, chose Value List for the Filter.
In the window that opens, add your strings one-by-one.
0 Kudos