Thursday 31 January 2019

arcgis desktop - Running iteration at end of another in ModelBuilder?


I would like to run two iterations. One assigning the respective attributes from the polygon file containing the cols and rows. And after that iteration another iteration that selects all of those attributes with the same name and saves them in a separate SHP file. However I have not been able to nest one iteration at the end of another iteration process?


Supposed parent iteration model:


enter image description here


The supposed sub model that should use the result of the parent model:


enter image description here


I haven't been able yet to find a way to connect them together, or to transfer the name of the main model's resulting file to the sub model's iteration.



Answer



In the second model, right-click on 'FeatureClass_SpatialJoin' and choose 'Model Parameter' to make this item into an input parameter for the model (it will then get a little 'P' next to it). Then save and close the model.



Now embed this second model within the first model - just drag the second model from the Catalog view into the first model's edit window. Then connect the output of your Spatial Join to the parameter of the second model. Ie, drag the connection to the second model itself, and choose the parameter from the pop-up list that appears.


You are already doing the right thing by having the two iterators in separate models. It's not possible to have more than one iterator in a single model, and this is ESRI's recommended way for using multiple iterators.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...