Select to view content in your preferred language

Setting up execution after false boolean in modelbuilder?

1208
3
07-25-2012 05:25 AM
MarcCusumano
Regular Contributor
I am modifying a model that creates a route for a selection of points, assigns a USER ID from an input box and a sequence number. I need to make a check box that asks if the user would like to solve the route. If the box is not checked, the route is not solved and only the USER ID will be populated, and the sequence number will not be assigned. I have the boolean variable set as a parameter and the model works when it is checked, but when it is unchecked the model will not run. How do I tell the model to skip the solve process and calculation of the sequence number field and move directly to calculating the user ID?

[ATTACH=CONFIG]16379[/ATTACH]
0 Kudos
3 Replies
SolomonPulapkura
Frequent Contributor
If the box is unchecked (boolean value is FALSE), the dependent tool will not execute. You probably have to create another boolean parameter for calculate field. For the entire model to run, both are checked. When only calculate field should be run, Solve is unchecked and calculate remains checked. Probably not the most elegant solution but as far as I know that's the way model builder booleans work. They dont execute the dependent tool if false, period. Since your calculate is further down the chain, that one does not execute too.
0 Kudos
MarcCusumano
Regular Contributor
Thank you for your suggestion Solomon. I tried setting up a separate boolean variable as a parameter on the calculate field tool for the LANID, but it did not work. The LANID gets populated but the sequence number remains null even though the route was calculated.


[ATTACH=CONFIG]16431[/ATTACH]

Does anyone have any idea how to make this work? It seems like it shouldn't be so difficult...
0 Kudos
SolomonPulapkura
Frequent Contributor
Have you looked in to using If-Then-Else in Model Builder?
0 Kudos