TransWikia.com

Preconditions not working on second iteration of ModelBuilder?

Geographic Information Systems Asked by Eirik Osnes on July 19, 2021

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

One Answer

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.

Answered by Yogesh Chavan on July 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP