branching in model

1179
8
08-01-2018 05:17 PM
ScottTaylor3
New Contributor III

I have created a model that clips, projects and then writes a raster to a floating point output.  I would like to be able to insert a true/false or if/then else type switch before running the float tool to enable the final out put to be selected by the user, that is, stopping it before the float tool if desired.  I don't use Python.  Is there a way to branch the model to either run the float tool or not?

Tags (2)
0 Kudos
8 Replies
DanPatterson_Retired
MVP Emeritus
ScottTaylor3
New Contributor III

Thanks Dan, but that's Arc Pro, we use 10.4...

0 Kudos
DanPatterson_Retired
MVP Emeritus

There are equivalent branching in ArcMap, 

Using If-Then-Else logic for branching—Help | ArcGIS Desktop 

ScottTaylor3
New Contributor III

Thanks again, but that requires python (which does my head in!).  I should have said that we use 10.4 in my original post, sorry about that.  I've circumvented the need by retaining data created in the intermediate steps but I'd still like to know if there's a way to use the one model but prevent unnecessary steps.

0 Kudos
DanPatterson_Retired
MVP Emeritus

The details are sometimes in the fine print.  So it is a simple calculation, give it a try.... or create two models for each option... or just skip the option.

As an alternative to writing a script tool, you can also use the Calculate Value tool to test the condition and output a Boolean.

0 Kudos
ScottTaylor3
New Contributor III

Yep, tried the calculate value tool without success.  It just surprises me that no obvious tool exists to allow an option to branch in a model tool where a sequence of steps is the whole purpose.  Oh well!

0 Kudos
DanPatterson_Retired
MVP Emeritus

Examples of using logical tools in ModelBuilder—Tools | ArcGIS Desktop 

If Value Is section 

The If Value Is tool in ModelBuilder

You need input parameters to your model then like "Float the stuff" (in place of are you flexible with the price)

If you have no model parameters, then no choices can be made.  Branch your model from there. 

The user has to make the choices upfront obviously

curtvprice
MVP Esteemed Contributor

Great discussion of this topic in this old blog post series - but still relevant for ArcMap (Pro has some new branching functionality!):

If You Are Stuck At If

0 Kudos