Location/Copy path in PRO (for python scripting)

08-02-2018 11:51 AM
Status: Under Consideration
Labels (1)
Occasional Contributor III

I talked to a representative about this at the developers summit but wanted to also put it here.

I do a lot of scripting in python and rely heavily on the path location functionality in arcmap to quickly get and copy the paths to featureclasses, geodatabases, and rasters.   

in Arcmap:

To get "a" path in PRO, you have to open the catalog, drill down to the database, dataset, and then featureclass or other data to get the path up to that point. You still have to then type out the name of the data.  Also, the path in PRO goes to the connection file location and then to the data in the database. This provides problems with sharing scripts, since others will not have access to your connection file location. 

I'd like the Arcmap location ability in PRO to easily copy the paths to data:

 Database Connections\XXXX@coopsde.sde\coopview.sde.hydrography_CLC\coopview.sde.lakes

Adding a copy path to the right click menu would be great.



In the Clipboard group there is a Copy Path button:

You can multiselect and it also works with portal items:

Does that work for what you need?

It still sounds like you were looking for this intuitively in a right-click menu?


Thanks Kory,

In order to get the copy path, I'll need to open the map (its not available in a layout?)- select the layer in the database, and then copy path is activated.  That is a cool feature to be able to multi-select and copy- I am going to use that a lot!

I can't remember the representative's name at the developers conference, though I think we thought having it as a right click option would be the most intuitive method.

Another issue that I see is that the copy path in the clipboard also copies the path to where the connection file is stored.  Since I don't want to have to make new connections to my databases every single time I create a new project, I use the favorites folder.  In my case the copied path is:


This wont work for being able to share scripts without doing some editing, or me giving up on using the Favorites folder database connections...  Simply, my coworker wont be able to use my connection file path.  Since PRO stores the connection files in the project, I am thinking I will need to maintain a folder of connection files similar to the way its done in 10.x., or I will have to create one project on each server that is dedicated to containing the maintenance scripts and connection files?

Am I missing something, or not seeing something that I should be? Will "Database connections\" still be viable syntax for scripts outside of a session?


It sure would be helpful to be able to access an SDE connection in python for Pro that does not have a user defined.


Clicking "copy path" still provides windows-style (backslash) paths, and for SDE the path is a bit heavy.   I agree that something akin to "Database Connections", or maybe having some functions such as arcpy.Home() and arcpy.Favorites() - or at least providing some instructions on how to easily create a variable for the default Favorites folder on help pages such as those I'm listing below - is essential.

***And please fix the misleading (and not reproducible) example that uses "Database Connections" on the Pro-branded page Create lists of data—ArcPy Get Started | ArcGIS Desktop ***

Python migration from 10.x to ArcGIS Pro—ArcPy Get Started | ArcGIS Desktop 

ArcGIS Pro Python Reference—ArcGIS Pro | ArcGIS Desktop 

Status changed to: Under Consideration