Select to view content in your preferred language

Pick List using Python for a Model

896
2
06-03-2010 12:47 PM
SheriNorton
Frequent Contributor
I am trying to create a model that will start by clipping an input layer of water bodies using a selected municipal boundary feature as the clipping layer. I'd like to display a GUI with a drop-down list reading all the values of a field in the municipal boundary layer (e.g., "Name") that the user can select from. The selected feature would then be used as the parameter for the Clipping Layer of the CLIP tool.

I'm pretty sure Python will be needed to accomplish this user input. Has anyone developed the code in Python to display a dialog with a drop-down menu populated with field values? Thanks so much for any assistance!
0 Kudos
2 Replies
KevinHibma
Esri Regular Contributor
If your list is static you can write out a value list.
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=792&pid=786&topicname=Managing_parameters
(see screen shot)

I haven't tried to do this as a dynamic list at run time via python. It could be worth a try. However if the list is static, I'd simply use the value list to save the overhead of reading the records everytime and creating a list.
0 Kudos
CarolineJackman
Occasional Contributor
This is something I would like to do also...
I realise I could type the list manually in, but this is not a good solution when the list is constantly changing. It would be much easier to be able to make the list based on field values, same as is done within the SQL editor already.
Any help would be greatly appreciated.
Thanks
Caroline
0 Kudos