Select to view content in your preferred language

ModelBuilder Not Iterating Over Process

516
3
Jump to solution
03-12-2024 04:40 PM
MPach
by
Frequent Contributor

With this model I'm trying to iterate through a polygon feature class that contains different areas in a city. I'm using the Select by Layer by Attribute tool to specify a starting point in my file to begin the iteration, which in this cases is "Object_ID = 1".  Then I'm using the Select Layer by Location tool to select all the sewer services that are located in these areas. I know this is where my problem lies. FYI, the portion of the model where the problem is starts at the bottom half from the blue oval titled "FeaturesBeingSelected". The model then continues to attempt to run Summary Stats for each of these areas and is set up to return a table with the count for material type for each area. Each table is the output with the appropriate name for the area and written to a geodatabase. 

Here's the problem: I noticed all the tables are coming out empty except for the first table. I was able to figure out that Select Layer by Location tool is Not reselecting the sewer services each time it iterates through each area. I'm kind of in a crunch for time otherwise I would fiddle with this more and figure out how to make this work. 

Can anyone help me with this please? I feel I've missed something pretty simple. 

Thanks, 

Mark

ModelBuilder.png

 

 

 

0 Kudos
1 Solution

Accepted Solutions
MPach
by
Frequent Contributor

I knew I was doing something really silly and just couldn't find it. It turns out the expression (SQL statement) that I had set originally for the "Select Layer by Attribute" was set to Object_ID = 1 to have the model start at the first record. When I decided to go a different route with the Modelbuilder iterator tool I left this in so through every iteration of the model it would reselect the first record at that point. Simple solution get rid of that whole section of the model because it was unnecessary and repetitive. 

Thanks for looking and trying to help. It took a call into ESRI tech support for me to walk the analyst through what the model was doing when I realized what I had done wrong! DOH! Much appreciated!

ModelBuilder.png

 

View solution in original post

0 Kudos
3 Replies
MichaelVolz
Esteemed Contributor

Have you ever thought of exporting the model to python and working directly in python to setup the iteration?

0 Kudos
MPach
by
Frequent Contributor

Yes, I was actually going to write it in Python originally, but I hadn’t written in Python for a while so I decided to use modelbuilder instead. 

0 Kudos
MPach
by
Frequent Contributor

I knew I was doing something really silly and just couldn't find it. It turns out the expression (SQL statement) that I had set originally for the "Select Layer by Attribute" was set to Object_ID = 1 to have the model start at the first record. When I decided to go a different route with the Modelbuilder iterator tool I left this in so through every iteration of the model it would reselect the first record at that point. Simple solution get rid of that whole section of the model because it was unnecessary and repetitive. 

Thanks for looking and trying to help. It took a call into ESRI tech support for me to walk the analyst through what the model was doing when I realized what I had done wrong! DOH! Much appreciated!

ModelBuilder.png

 

0 Kudos