3

I have these two nested models (sub-models) that are buffering each feature in a feature class and creating a shapefile for each result (their geoprocessing is identical). They both work fine when run standalone.

Model running Iterate Feature Selection

Model running Iterate Feature Selection

I'm trying to take the list of shapefiles created by both nested models and pass it back to the parent model (below). Then the parent model needs to iterate over the lists and perform merge (and more). The merge needs to be based on matching values of one attribute; there is a 1:1 relationship in the lists. So the one item from nested model A is merged with one item from nested model B, etc.

I tried Collect Values on the output of Copy Features and (in the parent model) the Merge could not see the Collect Values results as valid inputs.

How can I get the lists back to the parent such that it can iterate on them?

Parent model


Based on the comment from @Hornbydd, I changed the models as shown below - the two "sub-sub" models, that is, the innermost layer of nesting; the sub model, the next layer, and then the parent. If the first question was not clear, the intent is only to do the merge on two of the output files, i.e. Copy Feature results, at a time. The models as they are merge all the Copied Feature results into one feature class. I want the merge to take "one_1k_ft" and "one_1_mi" then "two_1k_ft" and "two_1_mi" etc etc. A common field exists in both attribute tables so ideally I can merge based on matching values there.

Subsubmodel_A

Subsubmodel_B

Submodel_A

Parent_model

2

The Merge tool can only take a single list as input. To construct that single list you need to do the following:

  • Add a collect values tool to the output of each Copy Features tool in each of your sub-models and expose them as the Parameters, not the output of your Copy Features.
  • Make sure both models are writing to a single workspace.
  • Add these sub-models to a model and make them preconditions to a FeatureClass iterator.
  • The output of the iterator should feed into a collects values tool exposed as a parameter
  • This model become a sub-model in your final master model and as you have exposed the collects values tool as a parameter you'll be able to connect it to a merge tool.

So you have your 2 sub models in a sub-model in a master model!

  • Thanks for the pointers. It's progress. Please see my revision above, thanks! – Kevin R. M. Dec 20 '17 at 0:35
0

I solved this by scripting it in arcpy; these pages were instrumental:

What is Python equivalent of ModelBuilder's Iterate Feature Selection?

http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/make-feature-layer.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.