3

I have a model that has two preconditions, in which I need to figure out if there is a way to prioritize one precondition to 'run' prior to the second. Is anyone aware of any built-in ability to do so with Model Builder or that can suggest a work around?

For instance, if I try to 'link' one precondition to another, I get the error "Can only connect a variable to a process", this is because my 'output' has a precondition that a python script needs to be run against it first, and then that output has the second precondition executed (but only once the original output has been altered by the Python script).

enter image description here

  • I'm having a bit of trouble understanding the problem. You need to run "Sum Field Insert New" before Altered Input, but you cannot link the python script to Altered input as a precondition? – Barrett Sep 2 '14 at 18:41
  • ^ @ Barrett - Correct, it says "Can only connect a variable to a process" - in my instance, 'SUM_FIELD_INSERT_NEW' is not a variable, it is a self-containing python script. – JumpInTheFire Sep 2 '14 at 18:47
4

Can you link the first precondition to the second precondition (so the first precondition must be true before the second fires) then link both (or just the second) to the final process?

Perhaps you can use If-Then-Else logic as output from your "Sum Field Insert New" process, and then link the output variable as the precondition to 'Altered Input?"

In ModelBuilder, if-then-else logic can be implemented by writing a script tool that tests some condition, then outputs two Boolean variables that describe the true and false condition and incorporating this script tool in a model. As an alternative to writing a script tool, you can also use the Calculate Value tool to test the condition and output a Boolean.

... One of the key steps in using branching logic in ModelBuilder is setting one of the conditional outputs as a precondition to further processing.

  • Thanks for the great suggestion, but unfortunately this doesn't work in my situation. I've edited my question to reflect what you said and to better help explain. – JumpInTheFire Sep 2 '14 at 18:32
  • Thanks Barrett, I'll look into writing a new script to help go about doing this. I just wasn't sure if there is/was a way that ArcGIS already had built in. – JumpInTheFire Sep 2 '14 at 18:48
  • 1
    @JumpInTheFire Don't write a new script. Modify your existing script to output the parameters as needed. See the example I linked. You shouldn't have much work to do. – Barrett Sep 2 '14 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.