I'm using Pro SDK 2.0 and have a geodatabase object for a file geodatabase. I'd like to get the file path of the geodatabase but haven't been able to figure out how?
trying out the sdk help files... but I probably have the wrong one...
ArcGIS Pro 2.2 API Reference Guide or
ArcGIS Pro 2.2 API Reference Guide
FileGeodatabaseConnectionPath Class
Represents the physical path to a file geodatabase folder that ends with the .gdb extension.
Here is a snippet that explains how to get the path:
QueuedTask.Run(() =>
{
using (Geodatabase defaultGeodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(Project.Current.DefaultGeodatabasePath))))
{
FileGeodatabaseConnectionPath connectionPath = (FileGeodatabaseConnectionPath)defaultGeodatabase.GetConnector();
MessageBox.Show($@"Path: {connectionPath.Path}");
}
});
You can paste this into the OnClick of a button Add-in to test it out.
Hope this helps,
Wolf