5

I'm working on a project where I have to iterate through geodatabases and handle some debug errors if they exist. For this I've created a ModelBuilder model, in ArcGIS 10.7.

Essentially, what the model does is iterate to the different databases (LoggGeoDB in the model) and using calculate value to determine if the file exists, using this as a precondition for selection. The calculation works fine, but the precondition fails on the second iteration.

First iteration

None of the data sets exist, and all the Select processes successfully do not run: "The process did not execute because the precondition is false." As intended.

Second iteration

Calculate Value and Calculate Value(3) finds their corresponding data sets and returns true, and the data is selected correctly. Calculate Value(2) still returns false, as intended, but Select Data(4) still runs, even though the precondition is false.

Any ideas for how to work around this - would prefer to keep it as a model if possible. I've tried to make the Calculate Value(2) always return false, bypassing the code, but the problem persists.

I also just tried making all the calculate value tools always return false, but Select Data(4) still attempts to run (the other two aborted as intended).

Model created to iterate

2
  • 1
    I've had issues with model builder remembering the initial state of a precondition and have reported it as a bug to ESRI UK. Try deleting Select Data (4), validate, add a new Select Data tool, break the links, validate, then rebuild links. Or even try building the model from scratch.
    – Hornbydd
    Commented Jul 11, 2019 at 11:55
  • Appreciate the feedback. Just removing and readding the Select didn't work. I'll try to remake the whole thing later to see if that does something. The weird thing is that it isn't the previous state either, as it's been false on all the iterations leading up to this. Commented Jul 11, 2019 at 13:09

1 Answer 1

0

For an iterator to work perfectly in ArcMap we need to add an inline variable (%Name%) along with the output.

In ModelBuilder, the contents of a variable can be used as a substitute for another variable by enclosing the substituting variable in percent signs (%). Substituting variables in this manner is called inline variable substitution.

Have a check if you might have missed one.

Your Answer

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

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