Select to view content in your preferred language

ArcGIS Pro Add-in: How to execute a model builder in .NET Visual Studio

710
1
Jump to solution
04-01-2022 12:27 PM
Labels (2)
JadedEarth
Occasional Contributor

I'm using ArcGIS Pro version 2.9.2.

I created a model builder that processes multiple geoprocessing tools (e.g., add multiple fields to shapefile attributes, perform spatial joins, delete fields, export final shapefile, etc.).

The model builder performs this on one US county at a time.  I want to create an Add-In that would loop through all the counties in each state, instead of me clicking the model for every county (which is time-consuming).

Is it possible to execute the model builder for each shapefile contained in a folder using an Add-In in Visual Studio?

Appreciate any suggestions.

0 Kudos
1 Solution

Accepted Solutions
Robert_LeClair
Esri Notable Contributor

Instead of building an Add-In I would incorporate an iterator in your Model to run the model for each shapefile in the folder using the IterateFiles iterator.  You can find details on it here and here.

View solution in original post

1 Reply
Robert_LeClair
Esri Notable Contributor

Instead of building an Add-In I would incorporate an iterator in your Model to run the model for each shapefile in the folder using the IterateFiles iterator.  You can find details on it here and here.