Sunday 22 January 2017

arcgis desktop - Iterating in ModelBuilder to Generate Output Files in Source Folder?


I have a very simple model that has a feature class iterator (recursive) that runs through a directory and sub-folders looking for line files and then projects them to UTM_16N. The only issue with the model is the destination for the output files.
image


Instead of having all the outputs going to a single destination I want them to be created in the source folder. So basically the model would dump the output in the same folder as the source file.


There are hundreds of folders each containing an individual line file and they all have the same name. The only identifier so to speak is the container folder name (counties in this case).



Answer



You need a subtle change to your model. See the image below:


enter image description here


Configure Expression parameter of Calculate Value like this:


enter image description here



Set Output Dataset or FeatureClass parameter of Project tool to %output_value%


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...