I am new to ArcGIS Pro and have just a "Basic" license. I have no Python coding experience.
I am trying to make a ModelBuilder tool that will Union multiple feature classes (as little as two but maybe up to 20). Since I only have the Basic license, I can only Union two feature classes at a time.
When I perform this manually I set up a bracket like this:
I union ShapeW to ShapeX to form Union 1. I then Union ShapeY to ShapeZ to form Union 2. I then Union 1 and 2 to form my final Union 3. With more shapes, my bracket just expands to more levels.
For my ModelBuilder I am using the following flow:
- Iterate Feature Classes
- If %n% <> 0 then go to Branch 1
- If %n% = 0 then go to Branch 2
- Both branches are similar in that they remove fields, delete rows etc. the difference is that Branch 2, exports the current Feature Class as Union0.
- I would like to have Branch 1 "Union" the current feature class (%n%) and the previous feature (%n%-1). So if %n% =1 it would Union the current feature class (ShapeX) and the previous %n%-1 (Union0).
The inline variable %n% keeps a count of the iteration. I would like use %n%-1 as an inline substitute variable. Is there a way to do this?