Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear all, bonjour.
Here bellow one code snippeds that will fire an event when deleting an occurrence inside an assembly (with several cuts for clarity) :
Private WithEvents asmEvents As Inventor.AssemblyEvents
Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate
g_inventorApplication = addInSiteObject.Application
asmEvents = g_inventorApplication.AssemblyEvents
End Sub
Private Sub asmEvents_OnDelete(ByVal DocumentObject As AssemblyDocument, ByVal Occurrence As ComponentOccurrence, ByVal BeforeOrAfter As EventTimingEnum, ByVal Context As NameValueMap, ByRef HandlingCode As HandlingCodeEnum) Handles asmEvents.OnDelete
MsgBox("Test")
End Sub
It works fantastic, but that doesn't trigger when deleting work points or work planes, which seems normal to me. How could I achieve such behaviour, maybe using an other existing event that I'm not aware of ?
Note that I would need to get the handles on that WorkPoint / WorkPlane that get deleted somehow.
Kind regards,
FINET L.
If this post solved your question, please kindly mark it as "Solution"
If this post helped out in any way to solve your question, please drop a "Like"Solved! Go to Solution.