Iterations in Model Builder

616
2
08-18-2011 03:27 AM
by Anonymous User
Not applicable
Original User: SMFrost

My goal is to run about 20 iterations of a model but at the moment I can't get it to do 2! I have a point shape file, I need to:
Select certain features
Select by location using those features with a grid to select the corresponding grid squares
Calculate a field in the grid to have a "1" in the selected grid squares
Deselect everything
Create a raster from the grid

There's then a load of other stuff which isn't important. No problem, this works.

BUT I want to do a second selection on the same dataset, same select by location, calculate the field to have a different set of squares with 1 and create a new raster. This is where I'm stuck. I have tried Lists and Series but nothing sems to work properly, it just creates the same raster twice. I attach 2 pdfs tos how what I am doing. I need to get the model to clear the first set of "1"s and use the second selection to repopulate.
Any ideas?

Thanks
Shona
0 Kudos
2 Replies
ShitijMehta
Esri Regular Contributor
Are you using %n% inline variable in the output name to save each output of the iteration?
Help at 9.3 on inline variable substitution

Other resources:

If you are using 10.0 - you can use iterators:

Help -


If you are using 9.3.1 you need to use a series type variable in the model to iterate.

Help -

0 Kudos
by Anonymous User
Not applicable
Original User: SMFrost

Hi, thanks for answering.

I am using 9.3.1 and I have checked out all the various help pages. Thanks for the downloads too, thay've given me more things to try but still nothing works. I'm guessing it's because I am doing a series of selections on the same datasets and not writing anything to a new file until the end. I presume Series doesn't go all the way through a model and then starts again with the next value but rather does each bit individually.

My next thought is to have a user input the values in the expression and run the model in batch but I can't see how that'd work either. I have no expreience in Python or any other programming hence my use of model builder.

Any thoughts/ help/comments greatly appreciated before I have to do this by hand.

Thanks
Shona
0 Kudos