Location/Copy path in PRO (for python scripting)

3080
8
08-02-2018 11:51 AM
Status: Implemented
Labels (1)
by Anonymous User
Not applicable

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.

8 Comments
KoryKramer

Jeff,

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?

by Anonymous User

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:

"C:\Users\xxxxx\AppData\Roaming\Esri\ArcGISPro\Favorites\xxxx@coopsde.sde\coopview.sde.administrative_COOP\coopview.sde.scwsd"

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?

MichaelVolz

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

JustinConnerWR

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 

NaicongLi
Status changed to: Under Consideration
 
NaicongLi
Status changed to: In Product Plan
 
NaicongLi
Status changed to: Implemented

Hello @Anonymous User,

Thank your for your feedback!

In ArcGIS Pro 3.0, we have added Copy Path to the context men of most item types, including items in databases:

NaicongLi_2-1656442076657.png

From any catalog window (the Catalog pane, catalog view, catalog view Contents pane), you can right click the item of interest and click Copy Path in its context menu to copy its path.  You have access to this command regardless whether it is a database connection file under a folder (as shown above), or a database connection already added to the project, under the Databases project container.

As to the separate issue of accessing and sharing a set of SDE connection files, the current workaround is to put this set of connection files in a folder on a network drive location that other people (to whom you are sharing these files) can access as well.

We appreciate your input and look forward to more of your ideas for improving ArcGIS Pro.

by Anonymous User

Hi @NaicongLi ,

Thanks for the update and that is awesome.  Will make scripting a whole lot easier and quicker!

Thanks,

JK