Take the 2-minute tour ×
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?

Thanks!

share|improve this question

3 Answers 3

up vote 7 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!!!! –  Halil Siddique 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.

e.g.

    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. –  Halil Siddique Dec 20 '11 at 13:53
1  
%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

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

 
discard

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.