I have come across an issue when using the "For" iterator. I want 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 runs the first two iterations, then overwrote the first one for the remaining iterations. So, with the increment set to 5, the starting timestep as 5 and the final as 20 I would expect to get 4 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 each time). 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. Can anyone shed any light on this? It is similar to an issue highlighted here: arcgis desktop - Does ModelBuilder have Iterate Field Values bug when model run without being in Edit mode? - Geographic… This is the model builder screen:
... View more