Why doesn't this work? iLogic Up to Date file data after save as file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This question is related to my earlier post, I'll try it this way because it drives me a bit crazy.
All I want is to Save As a file and have an Up to Date Path and Part Number through iLogic to be able to fill in some iProperties correctly.
See the code, which is handled as Event Trigger 'After Save Document'.
No matter what I try, the Path keeps pointing to the original file.
I've tried closing the file, putting a pause in the code, and then reopening the file as the most recent file, it all works, except the Path doesn't match.
However, when I manually run the Update rule, after that the correct Path is displayed.
Physically it really looks like the new document is loading, so why isn't the Path running with it?
Why doesn't that work in the rule?
Can anyone explain to me if/how an iLogic Event Trigger can be used to catch the Save As action?
MessageBox.Show("Document Name: " & ThisDoc.Document.FullDocumentName & vbNewLine & vbNewLine & _ "Part Number: " & iProperties.Value("Project", "Part Number"), "Test_After_Save_Document") Call ThisApplication.UserInterfaceManager.DoEvents ThisDoc.Document.Close Call ThisApplication.UserInterfaceManager.DoEvents System.Threading.Thread.CurrentThread.Sleep(3000) Call ThisApplication.UserInterfaceManager.DoEvents ' Open the most recent file ThisApplication.CommandManager.ControlDefinitions("FWxRecentFileCmd1").Execute Call ThisApplication.UserInterfaceManager.DoEvents InventorVb.DocumentUpdate(False) Call ThisApplication.UserInterfaceManager.DoEvents InventorVb.DocumentUpdate() Call ThisApplication.UserInterfaceManager.DoEvents iLogicVb.UpdateWhenDone = True Call ThisApplication.UserInterfaceManager.DoEvents MessageBox.Show("Document Name: " & ThisDoc.Document.FullDocumentName & vbNewLine & vbNewLine & _ "Part Number: " & iProperties.Value("Project", "Part Number"), "Test_After_Save_Document")
MessageBox.Show("Document Name: " & ThisDoc.Document.FullDocumentName & vbNewLine & vbNewLine & _
"Part Number: " & iProperties.Value("Project", "Part Number"), "Test_After_Save_Document")
Call ThisApplication.UserInterfaceManager.DoEvents
ThisDoc.Document.Close
Call ThisApplication.UserInterfaceManager.DoEvents
System.Threading.Thread.CurrentThread.Sleep(3000)
Call ThisApplication.UserInterfaceManager.DoEvents
' Open the most recent file
ThisApplication.CommandManager.ControlDefinitions("FWxRecentFileCmd1").Execute
Call ThisApplication.UserInterfaceManager.DoEvents
InventorVb.DocumentUpdate(False)
Call ThisApplication.UserInterfaceManager.DoEvents
InventorVb.DocumentUpdate()
Call ThisApplication.UserInterfaceManager.DoEvents
iLogicVb.UpdateWhenDone = True
Call ThisApplication.UserInterfaceManager.DoEvents
MessageBox.Show("Document Name: " & ThisDoc.Document.FullDocumentName & vbNewLine & vbNewLine & _
"Part Number: " & iProperties.Value("Project", "Part Number"), "Test_After_Save_Document")