
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Using Inventor 2012, I am writing VB code that opens, updates, changes parameters, and saves and closes a file.
My process so far opens one file, updates the parameters, saves, then opens the assembly file linked to the previous file to update, save, and close. The trouble I'm having is when I open the second file, Inventor prompts me to update the assembly, and won't do anything until I click yes (see attachment). Is there a way to either disable this prompt, or add VB code that would click YES everytime to update the file? Or perhaps a setting within Inventor that automatically saves and updates when you open instead of doing it in VB code?
Similarly, when the assembly file closes, it asks if I want to save it AND all the parts included in the assembly. I want it to click YES everytime to make sure it saves.
Through a web search, I found the .DisplayAlerts = True/False line, but it does not appear to work in my code
(i.e. if I use _invApp.DisplayAlerts = False).
My code for opening the second file (the .iam file) is basic and simplistic, as I am still new to this and learning.
_invApp.Documents.Open("filename.iam")
_invApp.ActiveDocument.Update()
_invApp.ActiveDocument.Save()
Thanks for reading all this and thanks in advance!
Solved! Go to Solution.