Guest User

Untitled

a guest
Feb 23rd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. import win32com.client
  2.  
  3. def TestFileDialog():
  4.  
  5. ThisApp = win32com.client.Dispatch("Inventor.Application")
  6. oFileDlg = ThisApp.CreateFileDialog()
  7. oFileDlg.Filter = "Inventor Files (*.iam;*.ipt) #|*.iam;*.ipt|All Files (*.*)|*.*"
  8. oFileDlg.FilterIndex = 1
  9. oFileDlg.DialogTitle = "Open File Test"
  10. oFileDlg.InitialDirectory = "C:\Users\logig\MoldTools"
  11. oFileDlg.ShowOpen()
  12.  
  13. TestFileDialog()
  14.  
  15. ---------------------------------------------------------------------------
  16. com_error Traceback (most recent call last)
  17. <ipython-input-1-b46d3a85376d> in <module>()
  18. 11 oFileDlg.ShowOpen()
  19. 12
  20. ---> 13 TestFileDialog()
  21. 14
  22.  
  23. <ipython-input-1-b46d3a85376d> in TestFileDialog()
  24. 9 oFileDlg.DialogTitle = "Open File Test"
  25. 10 oFileDlg.InitialDirectory = "C:\Users\logig\MoldTools"
  26. ---> 11 oFileDlg.ShowOpen()
  27. 12
  28. 13 TestFileDialog()
  29.  
  30. C:Program Files (x86)Microsoft Visual StudioSharedPython36_64libsite-packageswin32comclientdynamic.py in ShowOpen(self)
  31.  
  32. com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147467259), None)
  33. Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)]
  34. Type 'copyright', 'credits' or 'license' for more information
  35. IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
Add Comment
Please, Sign In to add comment