Sunday 17 July 2016

arcgis desktop - Can a folder connection in ArcMap Catalog window be added using Python?


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?



Answer



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.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...