I did test it with several pathes (on local harddisk and on a network drive) and it worked.
It did not work, however, when trying an UNC path ("\\servername\share\some\directory") or a path to a directory which does not exist, in both cases, it did show "My Computer".
Does your project path directory actually exist?
Internally, we're just using the .NET Framework FolderBrowserDialog
, so the (a little bit weird) rules for its "SelectedPath" property also apply to the "path" parameter of our browse_directory_dialog function.
One of the Rules is:
[...]as long as SelectedPath is an absolute path that is a subfolder of RootFolder (or more accurately, points to a subfolder of the shell namespace represented by RootFolder)
The default parameter for the root_folder is Environment.SpecialFolder.MyComputer, you may have better results with passing different values
for this parameter:
from __future__ import print_function
res = system.ui.browse_directory_dialog("Choose a directory", path="\\\\server01\\SomeShare\\some\\path", root_folder=System.Environment.SpecialFolder.Desktop)
print("The user did choose: '%s'" % res)
This value seemed to work also for network shares, but still not for non-existing pathes.
Check out the CODESYS store: http://store.codesys.com/CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions