Using model builder to export selected features

3855
1
09-26-2013 11:39 AM
DerekOlson
New Contributor
Hi all.  I'm working in 10.1, and I have a very basic problem that seems to be without solution.

I need to select data by year and season in a large point shapefile and export these selections to new shapefiles.  I am trying to use Model Builder to automate this cumbersome task, but there does not seem to be any way to actually output or save any of the temporary data layers created by the Feature Selection iteration tool.  I tried Make Feature Layer and Copy Features, but none of these functions will work iteratively.  Because the output file name has to be the same, the first output gets overwritten by the next iteration and the whole thing simply fails.  This seems like such a basic, fundamental task that I don't understand why it's not implemented better.  What is the point of having an iteration tool if you can't export the results?  Help?[ATTACH=CONFIG]27800[/ATTACH]
1 Reply
AkosKisreti1
Occasional Contributor
Hi Derek,

When you use iteration in ModelBuilder you have to use inline variables to ensure that your output files get different names and don't overwrite each other.

Click on this link to read about inline variables.

First of all use feature class to feature class tool, and for output feature class name use STATICTEXT_%Value%. Replace STATICTEXT with any text you want to use to name your new shp-s. %Value% is the inline variable.

Example:
YEAR  SEASON
2000  Summer
2000  Winter
2005  Winter

Output feature classes from iteration: STATICTEXT_2000_Summer; STATICTEXT_2000_Winter; STATICTEXT_2005_Winter

I attached a model and data you can use for this task.

Regards,
Akos
0 Kudos