Limiting Collect Values inputs in Model Builder

2908
2
09-17-2015 03:41 PM
JustinGleeson
Occasional Contributor

I am using Collect Values in Model Builder to collect the results from 6 separate iterative processes.

Each iterative process allows a user (through the GUI) to select a number of environmental variables under specific themes (1. Water, 2. Biodiversity....6. Climate) and apply a user weighting (1 to 3). Each selected indicator is then multiplied by the 'weight' in Raster Calculator and the results of the theme are stored in Collect Values. The next phase of the model uses Cell Statistics and Clip routine to produce the final output. The model works fine but I would like to be able to limit the GUI to only allow a max of 4 of the 6 theme results to be sent to Collect Values. At the moment Collect Value accepts all 6 Theme results.

I'm looking for some ideas on how I can get the GUI to only let the model progress (Submit) if a max of 4 of the potential 6 Themes are selected.

The image below shows the GUI with a number of Themes (Water, Culture etc) indicators and user defined weights visible.

The second image shows the actual model with the 6 iterative results going to Collect Values

Also - any advice on how I can get a tooltip to appear when there is a mouse-over on the Submit button would be great

thanks

Justin

GUI.jpg

Model.jpg

0 Kudos
2 Replies
FreddieGibson
Occasional Contributor III

You would need to implement a Scrip tool within your model that uses validation logic to collect the number of items selected in your parameter. You could have the tool dialog throw an error on the parameter, which would prevent the user from executing the tool, until your condition is met.

Understanding validation in script tools

http://desktop.arcgis.com/en/desktop/latest/analyze/creating-tools/understanding-validation-in-scrip...

Customizing script tool behavior

http://desktop.arcgis.com/en/desktop/latest/analyze/creating-tools/customizing-script-tool-behavior....

** Note: You'll want to seek out the "To Customize a message" section in the above page.

0 Kudos
JustinGleeson
Occasional Contributor

Hi Freddie,

Thanks for the pointers. I'll look into it and see how it goes.

Also - linked to the question on the Submit button in the Geoprocessing widget. Any idea if you can change 'Submit' to other text via the geoprocessing.xml config? I know you can do this in other widgets such as Splash with the following: <btnlabel>Click to accept terms and continue</btnlabel>

I've tried this in the geoprocessing config but it won'y work.

I'll post results once I get going on the script.

Thanks

Justin

0 Kudos