2

I am using trying to use an iterator to run through and folder of shapefiles and add them as input to the merge tool in ArcMap ModelBuilder. Something seems amiss; when I connect the iterate output file to the merge tool in ModelBuilder, it doesn't seem to take.

What am I doing wrong here?

enter image description here

2
  • I want to project all shapefile before merge but i cant do that Commented Jan 7, 2019 at 14:04
  • What am i doing? I added project but it cant do merge after that Commented Jan 7, 2019 at 14:06

1 Answer 1

3

First setup Iterate Feature Classes to loop through all your feature classes in a workspace, this will feed them one at a time into your next process, but if you put Collect Values as the next step in your process it will 'clump' all the individual feature classes into a cohesive input for Merge..

enter image description here

This workflow produced a merged feature class from all the feature classes in the workspace Area11_14.

4
  • 2
    Although this model will work I would say it is very inefficient. Merge will run as many times as the iterator loops. Merge only needs to run once taking a list of inputs. The iterator and collects tool need to be in a sub-model with Output Values exposed as a parameter then this entire model sits in a master model feeding into a single merge tool. Performance will be significantly better.
    – Hornbydd
    Commented Jan 7, 2019 at 16:19
  • 1
    I agree @Hornbydd, it is inefficient, it would make it work better by making a sub-model for processes up to collect events but thought at the time that a 2-step process would complicate the solution to the point where the OP would have difficulty following it. Commented Jan 7, 2019 at 22:45
  • 1
    I did feel like I was telling you how to suck eggs! Thought if anyone reads the comment that they may take it to the next level and do it as a sub-model.
    – Hornbydd
    Commented Jan 7, 2019 at 23:28
  • 1
    Agreed, or even better as a script in python, this is one of those instances that is tricky in model builder but so much easier in python. If anyone is reading this post note the comments and be inspired to try a submodel or have a go at python scripting (hint arcpy.ListFeatureClasses resources.arcgis.com/en/help/main/10.2/index.html#//… and the associated examples) Commented Jan 7, 2019 at 23:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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