Select to view content in your preferred language

Ordering iterative process execution in Model Builder.

1291
5
09-01-2011 12:37 PM
RobertMaynard
Emerging Contributor
Hello.

With an iterative model (processing rasters) is there any way to force Model Builder to run all rasters through one branch before moving to the next branch?

Thanks.
0 Kudos
5 Replies
ShitijMehta
Esri Regular Contributor
Try:
There is something called Precondition. You can set a precondition from the last tool of your branch 1 to the first tool of your second branch. Check the link.

If this is not useful:

Please give some more details.
Which branch/What is that branch doing?
0 Kudos
RobertMaynard
Emerging Contributor
I have several rasters I'm iterating.  Each branch of the model determines the difference between the iterative rasters and a constant raster, takes that result and adds/subtracts a predetermined value (1,2,3, etc.) and then produces a shapefile based off of the result.

As it is now, each iterative raster runs through branch 1, branch 2 , etc. and then the next raster runs through branch 1, branch 2, etc.

I would like all iterative rasters to run through branch 1 and then all through branch 2, etc.

Does this explanation help?

Thanks.
0 Kudos
ShitijMehta
Esri Regular Contributor
Try:


Creating two separate models. (Is this a possible option?)

or

I am not sure what your branch two is doing, but

Again not knowing what your branch 2 is doing you can use the Collect Values tool to collect all the outputs from all the iterations and pass them to the main model. Suppose your main model is using the merge tool, it is easy use the output of the collect values from your 1st iterating model directly as input to merge. Merge tool takes a multivalue input so all values from the Collect Value can go into merge without problem.

or

Read the document on nested model and try something like the attached image.

Hope it helps.
0 Kudos
RobertMaynard
Emerging Contributor
Thank you.  I really appreciate the input.

I may be using the wrong terminology when using the word "branch".

I've attached a graphic showing a simplified form of the model in question.

Again, I'd like to have all rasters go through branch 1, then all through branch 2, etc.

Looks to me like models are fairly limited in this regard.  The nested model idea may be the route to go.

Thanks again.
0 Kudos
ShitijMehta
Esri Regular Contributor
May be nested model or just an if-then-else logic:

See
If-Then-Else Part 1
If-Then-Else Part 2
0 Kudos