Select to view content in your preferred language

Customize parameter behaviour in Modelbuilder?

1288
6
Jump to solution
04-05-2023 08:25 AM
Labels (1)
EvelynHsu
Regular Contributor

Are there ways to customize parameter behaviours in a model in ArcMap 10.8.1?

Specifically, I'd like to enable one model parameter only when another parameter (boolean type) is True.

In a script tool, I can achieve this by editing ToolValidator class. Can something similar be done with a model?

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

I don't see how that can be accomplished in modelbuilder, you may have to examine what is available via python's validation and switch from a model to a python tool, probably in Pro and not arcmap


... sort of retired...

View solution in original post

0 Kudos
6 Replies
DanPatterson
MVP Esteemed Contributor

preconditions perhaps, for example

If Value Is (ModelBuilder)—ArcGIS Pro | Documentation


... sort of retired...
0 Kudos
EvelynHsu
Regular Contributor

Thanks Dan. Perhaps I should add that I'm using ArcMap 10.8.1. Not the most ideal option...gotta make do with what is available 😕

0 Kudos
DanPatterson
MVP Esteemed Contributor
0 Kudos
EvelynHsu
Regular Contributor

Unfortunately preconditions and if-else logic don't quite give the same behaviour with model parameters. 

Preconditions and if-else logic can be used to control whether a step (say, Step A) should be executed. But, if parameters of Step A have been marked as model parameters, then regardless of whether Step A is executed, its parameters are always marked as mandatory parameters of the model and input values are expected.

What we wanted is the ability to conditionally enable model parameters in modelbuilder: if Step A does not meet the precondition, then its parameters should also be optional.

0 Kudos
DanPatterson
MVP Esteemed Contributor

I don't see how that can be accomplished in modelbuilder, you may have to examine what is available via python's validation and switch from a model to a python tool, probably in Pro and not arcmap


... sort of retired...
0 Kudos
EvelynHsu
Regular Contributor

Marking this as the solution as I couldn't find any other way to achieve it either. In the end we decided to switch to a python tool.

0 Kudos