Code:
Imports inventor
Imports System.Runtime.InteropServicesPublic Class Form1
Public IvApp As Inventor.Application
Public IvAsmDoc As Inventor.AssemblyDocument
Private WithEvents oInteractEvents As Inventor.InteractionEvents
Private WithEvents oMouseEvents As Inventor.MouseEvents
'= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
IvApp = GetObject(, "Inventor.Application")
IvApp.Visible = True
oInteractEvents = IvApp.CommandManager.CreateInteractionEvents
oMouseEvents = oInteractEvents.MouseEvents
TextBox1.AppendText(vbCrLf & "Starting InterAction!!" & vbCrLf & vbCrLf)
oMouseEvents.PointInferenceEnabled = True
oMouseEvents.MouseMoveEnabled = True
oInteractEvents.Start()
End Sub
'= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Private Sub oMouseEvents_OnMouseClick(ByVal Button As Inventor.MouseButtonEnum, _
ByVal ShiftKeys As Inventor.ShiftStateEnum, _
ByVal ModelPosition As Inventor.Point, _
ByVal ViewPosition As Inventor.Point2d, ByVal View As Inventor.View)
TextBox1.AppendText("MouseEvents_OnMouseClick" & vbCrLf)
End Sub
Private Sub oMouseEvents_OnMouseMove(ByVal Button As Inventor.MouseButtonEnum, _
ByVal ShiftKeys As Inventor.ShiftStateEnum, _
ByVal ModelPosition As Inventor.Point, _
ByVal ViewPosition As Inventor.Point2d, ByVal View As Inventor.View)
TextBox1.AppendText("oMouseEvents_OnMouseMove" & vbCrLf)
End Sub