Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to feed a list of feature classes (only one polygon per feature class, but up to 150 feature classes) into the Union tool in ModelBuilder by using a Feature Class Iterator and the Collect Values Tool.

Unfortunately, it does not work since "Collect Values" only works with Merge, Append, etc.

Does anyone know a workaround or another way to do this?

share|improve this question

You can do this by writing a python script that inserts a list of feature classes into the union tool.

To use this method:

  1. In Catalog create a toolbox
  2. Create a Script tool
  3. Make the input parameter Features Class that accepts multiple values
  4. Copy the code below to a text document
  5. Save the text document and change the extension from .txt to .py
  6. Reference the .py file within the Script tool
  7. Run the Script tool

    import arcpy
    myList = arcpy.GetParameterAsText(0).split(";")
    unionResult = "C:\\temp\\union.shp" # make sure you have this directory C:\\temp
    arcpy.Union_analysis(myList, unionResult, "ALL", "", "GAPS")
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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