How to Create a File Browser Using Ansys UI Toolkit?
Vishnu
Member, Employee Posts: 222
✭✭✭✭
You can create a file browser or a Folder browser using Ansys UI Toolkit or Windows Forms using clr.AddReference("System.Windows.Forms")
Tagged:
0
Best Answer
-
You can create a file browser or a Folder browser using Ansys UI Toolkit.
Below is an example of File browser.
def FileBrowser(): import clr clr.AddReference("Ans.UI.Toolkit") import Ansys.UI.Toolkit DefaultFolder = r'D:' FilePath =Ansys.UI.Toolkit.FileDialog.ShowOpenFilesDialog(Ansys.UI.Toolkit.Dialog(),DefaultFolder,'Sample Excel File(s)|*.xlsx',0,'Select File',None) if str(FilePath[0]) == 'OK': return list(FilePath[1])[0] FilePath=FileBrowser()
4
Answers
-
ExtAPI.UserInterface.UIRenderer.ShowFileOpenDialog()
can also be used.
0 -
This is another example with some more robust options for file save vs. open, multiple file selection, type filters, default directory, etc….
1