[GIS] Using Iterate Feature Selection export features to new feature class with unique names

arcgis-10.2arcgis-desktopiteratormodelbuilder

I'm trying to use ModelBuilder in ArcMap 10.2 to select features from a large data set (>30,000 features) based on a value in the field "Route" and have those selected features export to a file location with the the output containing the string "Route_" concatenated with the current selection criteria.

So for example, I want the tool to look at the filed route and select the first group of values, say Route = 101, export those features to a gdb dataset with the output name Route_101. Then the tool would select the next group of features, say "Route" = 102 and then export the selection to the same output location with the output name Route_102…and so on.

Model_Builder

Best Answer

I think you're pretty close with the Modelbuilder script you posted above. The "Iterate Feature Selection" tool returns the field value of the group of features currently being iterated through in the Value variable (not in Route). This variable can then be used as an inline variable to define the output path of each iteration using the %x% notation.

In the final output (Route_%Route%), change your desired destination path from something like C:/Route_X.shp to C:/Route_%Value%.shp. That should create a new correctly labelled output shapefile for each iterated field value in the dataset.

Related Question