A partner notified me about a problem he had found with my Attribute Helper add-in that I wasn’t aware of. He told me that if you have the new “Interactive Tutorial” and “Attribute Helper” add-ins both loaded, then Inventor will crash when you shut it down with the dialog below.

but had a good idea of the cause. I wasn’t following my own advice from this post almost a year ago. I made the changes recommended there so that my Deactivate method of the add-in went from this:
Public Sub Deactivate() Implements Inventor.ApplicationAddInServer.Deactivate
' Release objects.
Marshal.FinalReleaseComObject(g_inventorApplication)
g_inventorApplication = Nothing
If Not m_attributeButtonDef Is Nothing Then
Marshal.FinalReleaseComObject(m_attributeButtonDef)
End If
If Not m_UIEvents Is Nothing Then
Marshal.FinalReleaseComObject(m_UIEvents)
m_UIEvents = Nothing
End If
System.GC.WaitForPendingFinalizers()
System.GC.Collect()
End Sub
To this:
Public Sub Deactivate() Implements Inventor.ApplicationAddInServer.Deactivate
' Release objects.
m_attributeButtonDef = Nothing
m_UIEvents = Nothing
End Sub
With that change, the crash went away. I hadn’t published a new version of the “Attribute Helper” add-in for a couple of years so I’ve made this change and created a new installer. You can get the latest version of Attribute Helper here. After installing make sure that you’re running the latest version by checking that the version is 2.6, as shown below.

They are The source code for the add-in is also available on GitHub.
-Brian

Leave a Reply