' return the corresponding screen coordinates (in pixel) of a point in the drawing
' CamBAm.UI.CADView
'

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  ' values are of Single type 

    ' a Point3F that contain the data to convert in pixel, given in drawing units
    Dim p_draw As New Point3F

    ' set the value for the drawing coordinate to the origine of the Cambam universe
    ' to test the results, you can pan the display to change the position of the XY cross then run the script
    p_draw.X = 0
    p_draw.Y = 0
    p_draw.Z = 0

    'return the position in pixels on the screen of the 0,0,0 position in drawing coordinates
    p_screen = CamBamUI.MainUI.ActiveView.DrawingToScreen(p_draw)


    ThisApplication.AddLogMessage("X screen: " & p_screen.X)
    ThisApplication.AddLogMessage("Y screen: " & p_screen.Y)
    ThisApplication.AddLogMessage("")


End Sub