Changing workspace in modelbuilder

11680
1
06-01-2010 09:58 AM
ChristopherJursa
New Contributor
Hi,

I saw something on ESRI's website about changing paths in modelbuilder.

Say for instance, I have flow accumulation function in my model.  The input DEM path is
C:\temp\myGRID

I want to use something like
%workspace%\myGRID

How and where would I set the workspace variable in modelbuilder?  I do not want to use a scratch workspace. 

Is this the same as the current workspace variable at http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=Intermediate_data_and_the_scratch_work...

If so, where do I set it? 

Also, is there a way to iterate through a list of workspaces?  Again, if so, how? 

Thanks in advance!
0 Kudos
1 Reply
ShitijMehta
Esri Regular Contributor
1)

  • Edit your model.

  • Go to Model-->Model Properties-->Environments tab-->General and set the curreent workspace environment and the scratch workspace environment there.

  • Hit OK


Now use current workspace as %workspace% and scratch workspace as %scratchworkspace% in your input and output path respectively.


0r
2)




  • Right click anywhere in your model and from the side menu click Create Variable. Create a variable of type workspace. You can rename the variable to anything say: Input Workspace.

  • Provide the variable a workspace value and use it in other tools as %Input Workspace%.




**Its always recommended that you set the environments at the ArcMap/application level if all your models are using the same workspace.

----------------------------------------
Iterate though a list of workspaces or the feature classes and tables inside the workspaces?
What do you want to do by iterating over workspaces?
0 Kudos