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

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Sep 2, 2014 at 18:07
2
  • 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? Commented Sep 2, 2014 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. Commented Sep 2, 2014 at 18:47

1 Answer 1

5

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.

answered Sep 2, 2014 at 18:13
3
  • 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. Commented Sep 2, 2014 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. Commented Sep 2, 2014 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. Commented Sep 2, 2014 at 18:49

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.