7

I have created a set of general scripting tools for map automation, etc. In one of my tools a geodatabase is created in the workspace folder the script points to. Just out of curiosity, is there any way I can add a folder connection in the ArcMap catalog window once the GDB is created so the user doesn't have to manually create one (assuming they haven't already done so), or is that out of ArcPy's scope?

6

No it is not possible to add "Folder Connections" using Arcpy.

Folder Connections are stored in the ArcCatalog.gx file, which is typically located at

 c:\Users\*username*\AppData\Roaming\ESRI\*Desktopverion*\ArcCatalog\ArcCatalog.gx

This is a binary file, so forget about editing it.

The only thing you could possibly do is to create the Folder Connections you want on one PC, copy the ArcCatalog.gx file to a common location, and then have your script replace the local PC copy of ArcCatalog.gx file with the common one.

1

I have used this link HERE before to create a connection on my c:\temp folder. I would think you could use it in your "Database Connections" folder. The "Database Connections" folder for 10.0 is at: C:\Users\USERNAME\AppData\Roaming\ESRI\Desktop10.0\ArcCatalog, I would guess it is somewhere similar for 10.1

  • 3
    If you right-click your 1 of your connections in ArcCatalog and select properties - the Name will tell you its location. Then if you use the CreateArcSDEConnectionFile_management function - you should be able to add to this folder. – dklassen Jan 8 '14 at 17:00
0

Someone above said: """The only thing you could possibly do is to create the Folder Connections you want on one PC, copy the ArcCatalog.gx file to a common location, and then have your script replace the local PC copy of ArcCatalog.gx file with the common one."""

With a symlink (if that works the same as on *nix, I'm not entirely convinced when it comes to this Redmond system) you should be able to store an original .gx file in one location, and create a symlink to it, and then copy that symlink to whatever locations you desire and they all should use the same settings.

mklink link_name //path/whatever.ext

(https://technet.microsoft.com/en-us/library/cc753194(v=ws.11).aspx)

A symlink should to the system be indistinguishable from the original. That's the point with a symlink. (NOTE: symlink != shortcut) Whether or not ArcCatalog will choke on it when one copy changes the settings while another is reading it, is a whole other can'o'worms. Don't blame me if this info fries your database or your computer or leads your kids astray or gives you a sore toe or makes your pets run away!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.