Changing the default geodatabase

4958
7
01-10-2013 07:26 AM
DavidSinton
New Contributor II
In ArcGIS 10.x ESRI introduced the concept of default geodatabases where output from geoprocessing tools would automatically go unless directed otherwise. The location that ArcGIS chooses for this default geodatabase doesn't fit the needs of our organization. I'm wondering if one can change the location of the default geodatabase and the home folder too by using Python. I'm somewhat experienced in scripting with Python but I can't find anywhere in arcpy that allows one to make this change. Does anyone out there know how to script this?

Thanks,

David
Tags (2)
7 Replies
JenniferBorlick
Occasional Contributor III
You *should* be able to do it this way:
http://blogs.esri.com/esri/supportcenter/2012/08/09/want-to-redirect-your-default-geodatabase/

Just make sure you are looking at it in the ArcCatalog Pane of ArcMap and not in ArcCatalog directly.
0 Kudos
DavidSinton
New Contributor II
I was looking for a solution internal to ArcGIS. Maybe I'm wrong but the link you posted utilized ResEdit and that won't work for my needs.

Thanks,

David
0 Kudos
JenniferBorlick
Occasional Contributor III
If you are at 10.1 you can do this in ArcMap.
Open the ArcCatalog pane and look for the Options button on the far right of the bar.
Click on the Home tab.
Set a Path.
0 Kudos
MathewCoyle
Frequent Contributor
I was looking for a solution internal to ArcGIS. Maybe I'm wrong but the link you posted utilized ResEdit and that won't work for my needs.


The only solution internal to ArcGIS is in 10.1 as Jennifer described. To change this value in 10.0 requires a registry edit.
0 Kudos
curtvprice
MVP Esteemed Contributor
  I'm wondering if one can change the location of the default geodatabase and the home folder too by using Python. 


The home folder is an ArcMap and ArcScene (not ArcCatalog) thing; it's where the current map or scene document is saved. I suppose in arcpy.mapping if you save the current map document, that would do it.

The main purpose of the default geodatabase in ArcMap is to have a place to write scratch and output files if the user has not set up a current and scratch workspace (arcpy.env.workspace, arcpy.env.scratchWorkspace). In Python scripting, I think it's best to just set them directly.

The tweak under discussion here is how to set the default workspace for new map documents. This option (in the ArcMap Catalog window) is only exposed in the user interface in 10.0 SP5 and 10.1.
0 Kudos
MattWilkie3
Occasional Contributor II

I didn't find an accessible solution for v10 arcpy, however in Pro it's available out of the box as arcpy.mp.ArcGISProject().defaultGeodatabase.

See ArcGISProject—ArcPy | ArcGIS Desktop  and  file geodatabase - Setting default gdb from ArcPy? - Geographic Information Systems Stack Exchange  for more

0 Kudos
PaulLohr
Occasional Contributor III

I would like an answer to this as well, regarding ArcGIS Desktop. I posted a new question at the link below asking a similar question.

https://community.esri.com/t5/arcmap-questions/where-are-geoprocessing-environment-settings/m-p/1308...

This next link is helpful but it does not address Geoprocessing Environment Settings > Default Geodatabase and Scratch Geodatabase.

https://community.esri.com/t5/esri-technical-support-blog/want-to-redirect-your-default-geodatabase/...

 

0 Kudos