Removing connections and creating folder connections in an APRX with arcpy

885
3
03-21-2023 07:11 AM
Status: Implemented
AndyBates
New Contributor III

We organise a number of folder connections for each project, plus do not want all APRXs to be cluttered with unnecessary folder connections. Folder connections have the potential to get very messy. 

Would it be possible to add to arcpy in Pro to allow us to create and remove folder connections. That way when setting up a new APRX (which we do through python already) we can ensure that it has the correct project based connections and that unrelated connections are removed.

Cheers

Andy

3 Comments
DannyMcVey

Hi Andy,

How are you setting up a new APRX using python? 

Have you considered using Project Templates for this? 

Also, in lieu of a proper arcpy method for this, favorites (similar in function to folder connections) can be directly manipulated in the Favorites.json file located in the following directory:

%appData%\ESRI\ArcGISPro\Favorites

This process is documented here: FAQ: What are the methods for transferring customized settings in ArcGIS Pro from one machine to ano...

DannyMcVey

Looks like this is actually implemented in Pro 3.1. Please see the updateFolderConnections property on the ArcGISProject class here: ArcGISProject—ArcGIS Pro | Documentation

DannyMcVey
Status changed to: Implemented

New updateFolderConnections property on the ArcGISProject class.