Is it possible to set programmatically the Home Folder Path of a project? And then also get the path after setting it?
I can manually set it in Options settings. But having problems trying to get the home folder path in my program.
I don't want to use the default C:\ drive since sometimes users have no access to it in our servers.
Appreciate any help.
Solved! Go to Solution.
Note: if u wanted to change the default (default"s") for all projects u might find these snippets useful:
https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Content#set-generaloptions-to-use-defaults
Never mind. Found out the solution:
var homeDir = Project.Current.HomeFolderPath;
var drive = Directory.GetDirectoryRoot(homeDir);
if (drive == "C")
{
//Set the current directory.
Project.Current.SetHomeFolderPath(working_folder);
}
else
{
//Disable controls
TboxWorkingDir.IsEnabled = false;
BtnSetup.IsEnabled = false;
}
Note: if u wanted to change the default (default"s") for all projects u might find these snippets useful:
https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Content#set-generaloptions-to-use-defaults
Thank you. Solves my problem.