Product : Engine, Version : 4.1.6.1029, ArticleID : 41023429

HowTo : CursorPos returns always 0 for Z coordinate with all 3d views

Article41023429
TypeHowTo
ProductEngine
Version4.1.6.1029
Date Added2/6/2004
Submitted byMario Pellegrino
Keywords

Subject

CursorPos returns always 0 for Z coordinate with all 3d views

Summary

CursorPos returns always 0 for Z coordinate with all 3d views!!!!
There's any way to have the 3 coordinates of mouse position in 3d views?

Solution

You have to "transform" the point from DCS to WCS to see z.
You can do this with the "TransPoint" function as following:

Private Sub VDPro1_MouseMove(Button As Integer, Shift As Integer, x As Double, y As Double)
    Dim mypoints As Variant
       
    mypoints = VDPro1.CursorPos
    VDPro1.ActiveDocument.ActiveLayOut.TransPoint mypoints, 2, 0
    Text1.Text = mypoints(0) & "   " & mypoints(1) & "   " & mypoints(2)
End Sub
For more information see our help file at "TransPoint Sub" topic