' return the corresponding point in the drawing that match the pixel location on the view
' CamBAm.UI.CADView
' Point3F ScreenToDrawing(PointF pScreen)

Sub main()

    ' the values returned in p_screen are the XY coordinates in pixels ; 0,0 in the upper left corner
    ' the values can be negative if the point in the drawing universe is out of the display

    Dim p_screen As New PointF(100, 100)  ' a pixel position on the view ; x=100, y=100

    ' a Point3F that will contain the data in drawing units returned by the function
    Dim p_draw As New Point3F

    'return the position in drawing coordinates of the position given in pixels

    p_draw = CamBamUI.MainUI.ActiveView.ScreenToDrawing(p_screen)

    ThisApplication.AddLogMessage("X : " & p_draw.X)
    ThisApplication.AddLogMessage("Y : " & p_draw.Y)
    ThisApplication.AddLogMessage("Z : " & p_draw.Z)
    ThisApplication.AddLogMessage("")

End Sub