70001234 Check if mouse is inside the ViewCube using the Wrapper

Article 70001234
Type Wish
Product Engine
Version 7012
Date Added 12/1/2017
Fixed 7.7014.0.3 (12/1/2017)
Submitted by Frank Louis


How can I check if the mouse is inside the ViewCube or not during the mouse click? I use the VDF ActiveX Wrapper.


In version 7.7014.0.3 a new property was exported in the Wrapper, named ContainsMouse that needs the y and y coordinates of the mouse and returns a boolean true/false whether the mouse is inside or not the 3D Cube.

In VB6 you can use it like:

Private Sub VDraw1_MouseDownEx(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Double, ByVal y As Double)
Dim pixelX As Long
Dim pixelY As Long

   Call VDraw1.Render.ViewToPixel(x, y, pixelX, pixelY) '// from Display (view) coordinates to pixel coordinates

   If (doc.ViewCube.ContainsMouse(pixelX, pixelY)) Then '//doc is the vdraw1.ActiveDocument.WrapperObject
      Me.Caption = "is inside cube"
      Exit Sub ' don't do anything else inside the event
      Me.Caption = "not inside"
   End If

  ...... do things here as the mouse-click is outside the cube......

End Sub

Send comments on this topic.