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'm using ArcGIS 10.0 on Windows 7 64 bit Ultimate.

I've noticed that sometimes ArcMap's geoprocessing tools as well as scripts seem to forget my setting in the mxd (confirmed via arcpy.env.workspace and arcpy.env.scratchWorkspace.

Is there any way to get ArcMap to start using my specified GDB?

I'm familiar with the document properties and how I can change the default GDB for a map. The issue I'm seeing happens after I've set it and its been using an alternate GDB for a while.

I find that at random times, ArcGIS suddenly decides it wants to go back to using the "default default" (which annoyingly can never be changed. I can close and reopen the document, set the alternate GDB I use as the default againvia the properties dialog, but it will not move back to using the alternative GDB. Toolbox and scripts keep placing output in the default ArcGIS location (documents/ArcGIS/default.gdb).

I was however playing around with this and found manually settings the arc.env.workspace in the Python window seemed to magically bring it back (even though I was setting the same value?). Executing the verbatim sa tool I had just ran put output into the correct GDB even though the dialog settings nor the environment settings had "changed".

Has anyone else come across this behavior?

share|improve this question
    
Which OS & Version of ArcGIS are you using? –  Mapperz Mar 29 '11 at 14:16
    
Are you running into this problem when running scripts inside ArcMap (from toolbox) or outside (from a Python IDE)? @ mapperz I believe arcpy is only in ArcGIS 10. –  Nathanus Mar 29 '11 at 14:20
    
@panda To make sure I'm understanding you, when you run Geoprocessing tools and scripts inside ArcMap's UI, the workspaces are set to the wrong location? –  Nathanus Mar 30 '11 at 18:32
1  
I am running tools inside of ArcMap, both from the toolbox and the Python window. The workspaces are not set to the wrong values, its just every so often it just stops respecting the workspace and then starts outputting to the default location (in documents/ArcGis/default.gdb). I've found that reseting the workspace variables via the Python window seems to fix this. –  mindless.panda Apr 2 '11 at 15:39
2  
re: "default default" can never be changed, please see and vote for Ability to permanently change the default location of the Default Geodatabase –  matt wilkie Dec 8 '11 at 22:15
add comment

1 Answer

This ArcGIS help for Setting the Default Geodatabase might be what you are looking for. I believe the "Default" is something that has to be set upon each map document's creation. After that, it should be accessible through the settings in the MXD. I'm away from my station so I can't confirm the exact toolbar rigamarole.

However it should be noted that your scratch Workspace is not always the same as your Workspace (they are different by default, if I recall). When using arcpy, environments are inherited if you use the arcpy.mapping class to create a reference to a given MXD (I think), but I know they can all be set through use of arcpy.env.

If you want to set your database/workspace specifically when using a Geoprocessing tool in ArcMap, you can :
1) In ArcMap, click Geoprocessing > Environments. This opens the Environment Settings window.
2) Expand the Workspace category and enter the path to the workspace.
(See This page for more information.)

share|improve this answer
    
thanks - I'm familiar with these settings - the issue I'm seeing is in spite of. See my edit above - hopefully it makes it clearer. –  mindless.panda Mar 29 '11 at 3:30
add comment

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.