Model Browser & Ribbon Unresponsive after VBA Macro Finishes ..Sometimes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello.
Every so often when one of my VBA macros ends, I lose control over the model browser and ribbon and ultimately have to restart Inventor. I have attached a 30s video depicting the loss of control. There is no control over the model browser. I do not get a rectangle for the node under my cursor, and right clicking on a node does not give me a corresponding context menu. The ribbon will still perform commands, but there is no highlighting of the control under the cursor. Clicking constrain will still bring up the Constraint form, but the button is not highlighted before click. When I try to switch to another tab, the tab does not change, and then the command buttons no longer function.
I use the below to hide the Inventor application during macro operation so the user does not interfere, and then I bring it back up. This may happen about 5% of the time as well. Sometimes this loss of control takes place even when I do not toggle application visibility.
Public Sub InventorScreen(ByRef oApp As Inventor.Application, Visible As Boolean, ScreenUpdating As Boolean, Minimized As Boolean)
If Visible = True Then
oApp.Visible = True
ElseIf Visible = False Then
oApp.Visible = False
End If
If ScreenUpdating = True Then
oApp.ScreenUpdating = True
'oApp.ActiveView.Update
ElseIf ScreenUpdating = False Then
oApp.ScreenUpdating = False
End If
If Minimized = True Then
oApp.WindowState = kMinimize
ElseIf Minimized = False Then
oApp.WindowState = kMaximize
End If
End Sub
Is there some VBA code that can reinitialize the model browser and ribbon so I don't have to restart Inventor?
Many thanks in advance.
Rafael