5

I have a problem using the "For" iterator in Model Builder (v 10.2.2, 64 bit, Windows 7). I wanted to create a series of rasters using the "Constant Raster" tool. The model works as expected when run from within model builder, but when run as a model tool (both with and without parameters for the For variables) it did the first two iterations, then overwrote the first one for the remaining iterators.

So, with the increment set to 5, the starting timestep as 5 and the final as 20 I would expect to get 3 output layers "Const_5yr", "Const_10yr", "Const_15yr", "Const_20yr". When run from within the model builder, I get what is expected. When run as a stand alone tool, I get "Const_5yr" and "Const_10yr", but "Const_5yr" has the value expected for "Const_20yr" (and from the dialogue in the results window I can see that "Const_5yr" is being overwritten).

To add even more confusion, when I add the iterator model to another model, it works as expected when run as a tool, as well as within model builder.

This is the model builder screen:enter image description here

I realise this is similar to Does ModelBuilder have Iterate Field Values bug when model run without being in Edit mode? but am not sure if it's due to the specific iterators or a more general problem? Has anyone else had these issues?

1

1 Answer 1

2

Esri has registered 2 duplicate bugs corresponding to your issue:

  • NIM-103740 - When a model with an iterator is run from within ModelBuilder, it completes correctly, but overwrites the outputs when run as a tool;
  • NIM-098729 - In ArcGIS for Desktop 10.2.1, when running a model with the Iterate Feature tool, an incorrect number of outputs are generated only when running the model as a tool.

They occur in 10.2.x (not in 10.1) and are fixed in 10.3.

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.