Merge multiple output features in ModelBuilder

385
6
10-29-2021 11:51 AM
Labels (2)
KrishnaSunglieng
New Contributor II

Hello,

I am attempting to merge multiple outputs within ModelBuilder. I can successfully import multiple KMLs, separate the KMLs into points and lines and save lines to a new geodatabase. 

My issue arises when I try to take the saved line feature classes and merge them within the ModelBuilder. I have explored creating a sub-model and introducing that into my main model but no luck so far.

Any suggestions on how I can make this happen? 

Attached below is what I have so far.


InkedScreenshot 2021-10-29 114208_LI.jpg

0 Kudos
6 Replies
JayantaPoddar
MVP Esteemed Contributor

please use Collect Values (ModelBuilder)—ArcGIS Pro | Documentation in between the Output Feature Class Variable and Merge geoprocessing tool.



Think Location
0 Kudos
KrishnaSunglieng
New Contributor II

Thanks for the quick reply. I attempted adding the Collect Values utility but I get the same result as before. I believe my issue is coming up at the output of the Feature Class to Feature Class tool. The output Feature Class consistently only gives me a single line. 

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

For the Output Feature Class, use Inline variable substitution—ArcGIS Pro | Documentation

%Name%

JayantaPoddar_0-1635538808621.png

 



Think Location
0 Kudos
KrishnaSunglieng
New Contributor II

I've used the suggested methods, but when my model adds the line to the map I only get a single feature. I have attached the three outputs I am expecting as well as the Feature Class to Feature Class parameters. The map with the green lines is my current output. The map with the three colors is the desired output. 

Screenshot 2021-10-29 140341.jpgScreenshot 2021-10-29 140720.jpgScreenshot 2021-10-29 140410.jpgScreenshot 2021-10-29 140529.jpg

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

Work perfectly for me.

JayantaPoddar_0-1635571530539.png

Could you share how the parameters in Iterate Feature Classes look like? Also the second model where you have used the first model as a sub-model.



Think Location
0 Kudos
KedaravindanBhaskar
New Contributor III

Hi, I'm having a similar problem,

I'm trying to merge 4 outputs of an iterator within ModelBuilder. I used inline variable substitution and the iterator worked successfully, but I cannot re-merge the 4 outputs of the iterator. The iterator couldn't be captured in the photo since the model is large.



As you can see in the attached image there are 4 outputs (one for each compass direction) in the contents pane, but they are represented as only 1 in ModelBuilder.

Any idea on what I can do? Let me know if you need any more information.

Thanks.

0 Kudos