I have a watershed feature class with 273 polygons, in the attribute table there is a SiteID column that is populated as so: A1 A2 A3 A4 etc.

I also have a buffer feature class with 273 polygons with a SiteID column populated as so: B1 B2 B3 B4 etc.

I want to use model builder to iterate through each of the features classes and to clip Watershed polygon labeled A1 with Buffer polygon A1, and the Watershed B2 with Buffer B2 and so on.

I have tried model builder but couldn't get it to run properly, I tried batch processing after splitting both feature classes based on their SiteID column but it wont populated the input and clip parameters properly..

How can I make this happen?

I searched but did not find this exact question here on GIS Stack Exchange.

ArcPy 10.0 iterate through shapefile1 clip shapefile2 to shapefile1's polygons

How to Batch Clip in ArcGIS Desktop 10 using Python/ArcPy?

1 Answer 1


As your data follows a pattern of A1 matches B1 and A2 matches B2, etc you can achieve your processing using a FOR iterator and inline substitution to pass the matching numeric part.

The model would look as below:

Model used to process logic

By selecting from each layer their matching counterparts (e.g. A100 and B100) the clip tool will honor these selections during the clip. Make sure the output of the Clip tool has a unique file name too, this is done with the inline substitution.

  • I think I'm close but not sure if my For iterator is configured correctly, I don't have the To Value and From Value Variable in my model. I just have the For Iterator and the parameters are set From:1 To:273 By:1
    – ohnonotyou
    May 27, 2015 at 16:57
  • That's Ok I just exposed them as parameters to make the model easier to understand.
    – Hornbydd
    May 27, 2015 at 17:09
  • It worked!! Thank you for your help! For anyone else the parameters I uesed were as follows: For Iterator: From:1 To:273 By:1 Select Layer by Attribute: Type:New Selection Expression:"objectID"=%Value%
    – ohnonotyou
    May 27, 2015 at 17:32

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.