I've got the problem with handling inventor events in standalone VB.Net application.
While OnSaveDocument, OnActivateDocument, ... work fine, the events for BrowserPanes don't.
Here is my code:
Public Class Form1
Public invApp As Inventor.Application
Public appEvents As Inventor.ApplicationEvents
Public bPanesEvents As Inventor.BrowserPanesEvents
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call Inventor_connection()
' -----------------------------------------------------------
appEvents = invApp.ApplicationEvents
AddHandler appEvents.OnSaveDocument, AddressOf Me.appEvents_OnSaveDocument
AddHandler appEvents.OnActivateDocument, AddressOf Me.appEvents_OnActivateDocument
' ----------------------------------------------------------
activeDoc = invApp.ActiveDocument
bPanesEvents = activeDoc.BrowserPanes.BrowserPanesEvents
AddHandler bPanesEvents.OnBrowserNodeActivate, AddressOf Me.bPanesEvents_OnBrowserNodeActivated
End Sub
Public Sub appEvents_OnSaveDocument(ByVal docObject As Inventor._Document, _
ByVal b_or_a As Inventor.EventTimingEnum, _
ByVal context As Inventor.NameValueMap, _
ByRef handlingCode As Inventor.HandlingCodeEnum)
If b_or_a = EventTimingEnum.kAfter Then
MsgBox("Document saved!!")
End If
End Sub
Public Sub appEvents_OnActivateDocument(ByVal docObject As Inventor._Document, _
ByVal b_or_a As Inventor.EventTimingEnum, _
ByVal context As Inventor.NameValueMap, _
ByRef handlingCode As Inventor.HandlingCodeEnum)
If b_or_a = EventTimingEnum.kAfter Then
MsgBox("Document activated!!")
End If
End Sub
Public Sub bPanesEvents_OnBrowserNodeActivated(ByVal browserNodeDef As Object, _
ByVal context As Inventor.NameValueMap, _
ByRef handlingCode As Inventor.HandlingCodeEnum)
MsgBox("Browser node activated!!")
End Sub
End Class
Please help me.
Thx!