Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2014-07-25
Originally created by: M.Schaber
Hello,
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.
Zitat: [...]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)
from__future__importprint_functionimportSystemΒ Β 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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Is it possible that the path attribute of this method has no effect?
In the code:
Where projectPath is a valid string:
The prompt has "My computer" selected.
Thanks!
Originally created by: M.Schaber
Hello,
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:
different values for this parameter:
This value seemed to work also for network shares, but still not for non-existing pathes.
Thanks for your answer!
Specifying the Desktop folder instead of MyComputer worked perfectly.
Regards