I think you forgot your attachment in the earlier post. Here's some VBA code I wrote to test this. It's working fine for me.
To use this follow these steps:
- Create a new form in VBA.
- Place a button on the form (CommandButton1)
- Place two labels on the form (Label1 and Label2). Make them long enough that they can display a short sentence.
- Set the ShowModel property of the form to False. You can do this by selecting the form and changing the value in the Properties window.
- Copy the code below in the form module.
- With the form selected in the VBA environment, click Run to execute it. This should cause the form display. Clicking the button will start the selection process. Moving the mouse over the model will show the current position in the dialog. it always shows the same position for me regardless of the orientation of the camera.
Private WithEvents oInteractionEvents As InteractionEvents
Private WithEvents oSelectEvents As SelectEvents
Private Sub CommandButton1_Click()
Set oInteractionEvents = ThisApplication.CommandManager.CreateInteractionEvents
oInteractionEvents.StatusBarText = "Select a on the model."
Set oSelectEvents = oInteractionEvents.SelectEvents
Call oSelectEvents.AddSelectionFilter(kPartVertexFilter)
Call oSelectEvents.AddSelectionFilter(kPartFaceFilter)
oSelectEvents.SingleSelectEnabled = True
oInteractionEvents.Start
End Sub
Private Sub oSelectEvents_OnPreSelectMouseMove(ByVal PreSelectEntity As Object, ByVal ModelPosition As Point, ByVal ViewPosition As Point2d, ByVal View As View)
Label1.Caption = "Move Position: " & Format(ModelPosition.X, "0.000000") & ", " & _
Format(ModelPosition.Y, "0.000000") & ", " & Format(ModelPosition.Z, "0.000000")
End Sub
Private Sub oSelectEvents_OnSelect(ByVal JustSelectedEntities As ObjectsEnumerator, ByVal SelectionDevice As SelectionDeviceEnum, ByVal ModelPosition As Point, ByVal ViewPosition As Point2d, ByVal View As View)
Label2.Caption = "Select Position: " & Format(ModelPosition.X, "0.000000") & ", " & _
Format(ModelPosition.Y, "0.000000") & ", " & Format(ModelPosition.Z, "0.000000")
End Sub
Private Sub UserForm_Initialize()
Label1.Caption = "Move Position:"
Label2.Caption = "Select Position:"
End Sub