Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import win32com.client
- def TestFileDialog():
- ThisApp = win32com.client.Dispatch("Inventor.Application")
- oFileDlg = ThisApp.CreateFileDialog()
- oFileDlg.Filter = "Inventor Files (*.iam;*.ipt) #|*.iam;*.ipt|All Files (*.*)|*.*"
- oFileDlg.FilterIndex = 1
- oFileDlg.DialogTitle = "Open File Test"
- oFileDlg.InitialDirectory = "C:\Users\logig\MoldTools"
- oFileDlg.ShowOpen()
- TestFileDialog()
- ---------------------------------------------------------------------------
- com_error Traceback (most recent call last)
- <ipython-input-1-b46d3a85376d> in <module>()
- 11 oFileDlg.ShowOpen()
- 12
- ---> 13 TestFileDialog()
- 14
- <ipython-input-1-b46d3a85376d> in TestFileDialog()
- 9 oFileDlg.DialogTitle = "Open File Test"
- 10 oFileDlg.InitialDirectory = "C:\Users\logig\MoldTools"
- ---> 11 oFileDlg.ShowOpen()
- 12
- 13 TestFileDialog()
- C:Program Files (x86)Microsoft Visual StudioSharedPython36_64libsite-packageswin32comclientdynamic.py in ShowOpen(self)
- com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147467259), None)
- Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)]
- Type 'copyright', 'credits' or 'license' for more information
- IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
Add Comment
Please, Sign In to add comment