I've had this happen to me a few times before, and then once again today, tried spamming the esc key - and every other key on the keyboard for a bit as well!
I really couldn't afford to loose what I'd been working on, so tried everything to get it to stop. Luckily I found a solution that seemed to work in this case, and may be useful to others who find themselves in the same situation.
What I found was that if I right click an inventor file in the Vault application and select open, it would force Inventor to open the file, even though the ilogic loop was running. This initially didn't help much, since as soon as the file opens it goes back to the loop. So what i did in the end was this:
1. Open another instance of Inventor Application.
2. Create a new part.
3. Add an iLogic rule to the part that saves every open file, and skips any that fail.
4. Set a trigger for the rule to run when the part is opened.
5. Check the part into Vault.
6. Close that instance of Inventor
7. Right click the file in the Vault Application and select open.
The file opened, saved all my work and then proceeded to go back to the loop, at which point I crashed Inventor and opened my saved work back up :).
Hope this helps others!
Here's the save all code I used:
' iLogic: Save all open documents, skipping any that error.
' Drops dialogs (SilentOperation) and restores settings afterward.
Dim app As Inventor.Application = ThisApplication
Dim docs As Inventor.Documents = app.Documents
Dim total As Integer = 0
Dim saved As Integer = 0
Dim failed As New System.Collections.Generic.List(Of String)
' Remember app settings
Dim originalSilent As Boolean = app.SilentOperation
Dim originalScreen As Boolean = app.ScreenUpdating
Try
app.SilentOperation = True
app.ScreenUpdating = False
' Take a snapshot of currently open docs (collection can change while saving)
Dim openDocs As New System.Collections.Generic.List(Of Inventor.Document)
For Each d As Inventor.Document In docs
openDocs.Add(d)
Next
For Each d As Inventor.Document In openDocs
total += 1
Try
d.Save() ' Try to save everything
saved += 1
Catch ex As System.Exception
failed.Add(d.DisplayName & " — " & ex.Message)
' Skip and continue with the next document
End Try
Next
Finally
app.SilentOperation = originalSilent
app.ScreenUpdating = originalScreen
End Try
Dim report As String = _
"Save All — iLogic" & vbCrLf & vbCrLf & _
"Open docs: " & total & vbCrLf & _
"Saved: " & saved & vbCrLf & _
"Failed: " & failed.Count
If failed.Count > 0 Then
report &= vbCrLf & vbCrLf & "Failures:" & vbCrLf & "— " & String.Join(vbCrLf & "— ", failed.ToArray())
End If
MsgBox(report, vbInformation, "iLogic Save All")