iterators in modelbuilder
TRANSCRIPT
![Page 1: Iterators in Modelbuilder](https://reader035.vdocuments.us/reader035/viewer/2022081803/545aaf55af79594e128b5711/html5/thumbnails/1.jpg)
Esri International User Conference | San Diego, CATechnical Workshops |
Iterators in ModelBuilderShitij Mehta
12th July, 2011
![Page 2: Iterators in Modelbuilder](https://reader035.vdocuments.us/reader035/viewer/2022081803/545aaf55af79594e128b5711/html5/thumbnails/2.jpg)
Iteration = looping = repeat a process over and over
Iteration in ModelBuilder = Run entire model or asingle tool or processrepeatedly
Tools to iterate in ModelBuilder = Iterators
What is iteration?
Iterator
![Page 3: Iterators in Modelbuilder](https://reader035.vdocuments.us/reader035/viewer/2022081803/545aaf55af79594e128b5711/html5/thumbnails/3.jpg)
Iterates over a starting and ending value by a given value.
Iterates "while" a condition is true or false.
Iterates over features in a feature class.
Iterates over rows in a table. Iterates over each value in a field.
Iterates over a list of values.
Iterates over datasets in a Workspace or Feature Dataset.
Iterates over feature classes in a Workspace or Feature Dataset.
Iterates over files in a folder.
Iterates over rasters in a Workspace or a Raster Catalog.
Iterates over tables in a workspace.
Iterates over workspaces in a folder.
For Value While ContinueIterate
Feature Selection
Value
Selected Features
IterateRow
SelectionValue
Selected Rows
Iterate Field
ValuesValue Iterate
Multivalue Value
Iterate Datasets
Name
Dataset Iterate Feature Classes
Name
Feature Class Iterate
FilesName
File
Iterate Rasters
Name
RasterIterate Tables
Name
Table
Name
WorkspaceIterate Workspaces
![Page 4: Iterators in Modelbuilder](https://reader035.vdocuments.us/reader035/viewer/2022081803/545aaf55af79594e128b5711/html5/thumbnails/4.jpg)
Where to get help? Click Doc, Tutorials, Book
![Page 5: Iterators in Modelbuilder](https://reader035.vdocuments.us/reader035/viewer/2022081803/545aaf55af79594e128b5711/html5/thumbnails/5.jpg)
Shitij Mehta
Demo 1 – Iterating Feature Classes
![Page 6: Iterators in Modelbuilder](https://reader035.vdocuments.us/reader035/viewer/2022081803/545aaf55af79594e128b5711/html5/thumbnails/6.jpg)
Shitij Mehta
Demo 3 – Model within a Model
Main Model
Sub-Model
![Page 7: Iterators in Modelbuilder](https://reader035.vdocuments.us/reader035/viewer/2022081803/545aaf55af79594e128b5711/html5/thumbnails/7.jpg)
Rules for a using iterators
• Only one iterator can be used per model.
• Add only the tools you want to run as many times as an iterator in the same model.
• The output of any tool connected to the iterator can have (if required) a unique name for each iteration to avoid being overwritten by
• Using the system variable %n%C:\Sctatch\scratch.gdb\output_%n%
• Using the Name or Value output of the iterator C:\Sctatch\scratch.gdb\output_%Name% C:\Sctatch\scratch.gdb\output_%Value%
• Using any other variable in the model as an inline variableC:\Scratch\scratch.gdb\output_%XYZ%
![Page 8: Iterators in Modelbuilder](https://reader035.vdocuments.us/reader035/viewer/2022081803/545aaf55af79594e128b5711/html5/thumbnails/8.jpg)
Shitij Mehta
Demo 3 – Iterating Feature Selection
![Page 9: Iterators in Modelbuilder](https://reader035.vdocuments.us/reader035/viewer/2022081803/545aaf55af79594e128b5711/html5/thumbnails/9.jpg)
Questions?
![Page 10: Iterators in Modelbuilder](https://reader035.vdocuments.us/reader035/viewer/2022081803/545aaf55af79594e128b5711/html5/thumbnails/10.jpg)
Thank You!!!!
Please fill out the online evaluation form.www.esri.com/sessionevals