Select to view content in your preferred language

How to run the same model builder in different geodatabases?

1308
3
08-23-2014 07:49 AM
JoseSanchez
Frequent Contributor

Hi all,

I am going to work on a model builder script run it in my desktop geodatabase, then I want to test it in a SDE development database and deploy it to an SDE production geodatabase.  Is there a tool in Model Builder that allows to point to a specific geodatabase, instead of changing the properties of each feature to change the path to the feature class in the new geodatabase.

Thanks.

0 Kudos
3 Replies
Luke_Pinner
MVP Regular Contributor

Set your input /output feature classes as model parameters.

0 Kudos
RiyasDeen
Frequent Contributor

Hi Jose,

If you want to use a Model then, I can't think of any option other than what Luke has suggested. If you can export your model as a script then, possibly you can attempt below.

  • Create an environment variable pointing to a txt file, containing your feature class variable parameters.
  • Get the environment variable in your python script and read through the file to create a dictionary of values.
  • Use the variables in the dictionary as input for your processes.

Attached script reads a variable file.

Below was the content of my variable file.

var1||something

var2||C:\tempdelete\PL_TO_LINE.gdb\PL\CONSOLIDATED

var1||override

0 Kudos
JoseSanchez
Frequent Contributor

Hi,

It seems that "Setting environments for an entire model"  in Desktop » Geoprocessing » ModelBuilder » Using ModelBuilder to execute tools is what I need

thanks

0 Kudos