Sign up ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have created a model in ModelBuilder. The first step is for the user to specify the location of the File Geodatabase that all the outputs will be saved in. What I want is for all the outputs (from the different tools within the model) to be saved in that FGDB; however, it could be called anything and located anywhere.

So how do I cause the output to be saved in the location that is specified in the first step?

share|improve this question

4 Answers 4

up vote 8 down vote accepted

This page on Esri's site should give you all the information you need to do this within ModelBuilder. Essentially you create a variable for the output folder/geodatabase -- which can be user-generated or hardcoded -- and then call it in the other tools by its name, surrounded by % symbols.

share|improve this answer
Perfect, Thanks!!!! – MapMan Dec 21 '11 at 9:15

First create a script and define the input feature class and output workspace path parameters. Next, export out the model to python script or vbs. Then, you can just edit the code to use the output workspace variable for all the intermediate tools based on the original output workspace that the user defines.

The example below illustrates this using arcpy, however you will have to use just python or vbs since you are using version 9.3.1 and not 10.


    inputlayer = arcpy.GetParameterAsText(0)
    outputpath = arcpy.GetParameterAsText(1)

    # Process: Buffer
    arcpy.Buffer_analysis(inputlayer, outputpath + "\\buffer.shp", "50 Feet", "FULL", "ROUND", "NONE", "")

    # Process: Select
    arcpy.Select_analysis(outputpath + "\\buffer.shp", outputpath + "\\bufferSelect.shp", "")
share|improve this answer
I was hoping to do it all within ModelBuilder rather then exporting it out. I've had a look at some models that the person who use to work here previous to me, and he has set his FGDB in the 1st step, then has used "%Temp FGDB%" for the other outputs, but I cant seem to get it to work. – MapMan Dec 20 '11 at 13:53
%Temp FGDB% would work if you changed the name of the parameter bubble in ModelBuilder to Temp FGDB: whatever the parameter bubble is called is how it can be referenced in the other tools. – nmpeterson Dec 20 '11 at 15:29

I figured out a simple way to do this in model builder. Lets say you're are iterating over a few files to do a clip to all of them.

1) Create an interator for feature classes. Right click on it and make a variable for the workspace.

2) Rename the workspace bubble to "Workspace", and also right click on it and select "make parameter". This will prompt you to enter in the folder containing the files when your run the model as a tool.

3) add the clip tool. run a line from the "FeatureClass" output bubble of the iterator to the clip tool, and select input feature.

1) add in the "Create Folder" tool, and right click on it and create two variables from it, name and location.

2) make the name of the folder whatever you want it to be. I used "Output"

3) For the location: In my case I already had the folder where I wanted to output folder to reside. It was the main folder i used as the input for the iterator.Remember I renamed that to "Workspace". Now we can refer to that location by typing in:


into the location bubble for the create folder tool.

4) Now, you use the connector tool to draw a line from the output of the "Create Folder" tool (named "Output Folder" for me) up to the main iterator bubble). It will display a little dialog, pick the option "precondition". This will tell it that it needs to create the folder before running this section.

5) Finally, in the output of your clip tool, you can type:

%Output Folder%\%Name%_clip.shp

The %Output Folder% references the output bubble of the folder that we created. the iterator creates a bubble called "Name" for you, so we referenced that by %Name%. Then I add a suffix to make it clear that it's an output from the clip tool.

I hope that helps! Adam

share|improve this answer

You can use the "feature classes in a geodatabase" tool at the tip of your model builder, where you can connect many outputs to it. You'll have just to specify its location. Good luck

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.