CreateFileDialog not working in 2019

CreateFileDialog not working in 2019

DWhiteley
Advisor Advisor
1,136 Views
10 Replies
Message 1 of 11

CreateFileDialog not working in 2019

DWhiteley
Advisor
Advisor

This code works fine in 2018 but not in 2019 (build 136)

 

' Create a new FileDialog object.
Dim oFileDlg As Inventor.FileDialog
Call Me.m_inventorApplication.CreateFileDialog(oFileDlg)

oFileDlg.Filter = "Drawing Files (*.idw;*.dwg)| *.idw;*.dwg"

oFileDlg.FilterIndex = 1

oFileDlg.DialogTitle = "Select drawing template"

oFileDlg.InitialDirectory = oTLoc
oFileDlg.InsertMode = False
oFileDlg.MultiSelectEnabled = False
oFileDlg.SuppressResolutionWarnings = True

oFileDlg.CancelError = False

oFileDlg.ShowOpen()

 

The dialog box opens, I can select a file (in this case DWG or IDW), but when you click on OPEN nothing happens.

 

 

 

Dave

Envisage

0 Likes
1,137 Views
10 Replies
Replies (10)
Message 2 of 11

MechMachineMan
Advisor
Advisor

Where is the rest of the code?

 

CreateFileDialog is simply a function that shows a form and RETURNS a file name as string, it does not do any operations with the selected file.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 11

DWhiteley
Advisor
Advisor
Correct, but in 2019 the ‘open’ button does nothing.
0 Likes
Message 4 of 11

DWhiteley
Advisor
Advisor
Btw the code this is used in has worked fine from release 2014-2018. It fails in 2019 with the open button being inactive and hence returning no file name. Only cancel works.
0 Likes
Message 5 of 11

MechMachineMan
Advisor
Advisor

And as in 'nothing' you mean as in it's like you didn't even click it?

 

It doesn't even close the dialog by pressing open?


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 6 of 11

bradeneuropeArthur
Mentor
Mentor

try this:

 

Public Sub dd()

' Create a new FileDialog object.
Dim oFileDlg As Inventor.FileDialog
Call ThisApplication.CreateFileDialog(oFileDlg)
oFileDlg.Filter = "Drawing Files (*.idw;*.dwg)| *.idw;*.dwg"
oFileDlg.FilterIndex = 1
oFileDlg.DialogTitle = "Select drawing template"
oFileDlg.InitialDirectory = oTLoc
oFileDlg.InsertMode = False
oFileDlg.MultiSelectEnabled = False
oFileDlg.SuppressResolutionWarnings = True
oFileDlg.CancelError = False
oFileDlg.ShowOpen

Dim a As Document
Set a = ThisApplication.Documents.Open(oFileDlg.FileName, True)

End Sub

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 7 of 11

DWhiteley
Advisor
Advisor
Very funny! Yes of course, I did click it but nothing happens.
0 Likes
Message 8 of 11

MechMachineMan
Advisor
Advisor

Sounds like a bug for our Autodesk employee friends to investigate then.

 

(I'm not on 2019 yet or else I would try investigating further myself)

 

@chandra.shekar.g or @johnsonshiue


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 9 of 11

bradeneuropeArthur
Mentor
Mentor
Does this have any influence:

https://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.options(v=vs.110).aspx

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 10 of 11

DWhiteley
Advisor
Advisor

 

I now have this working, by using an earlier version of the inventor.interop

 

(OPEN button not responsive in .showopen)

 

Dave

Envisage 

0 Likes
Message 11 of 11

chandra.shekar.g
Autodesk Support
Autodesk Support

@DWhiteley,

 

Could please demonstrate working of open dialog in Inventor 2018 with a sample screencast or video record?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes