RobotStudio event

GraphicControl.ProjectPointToScreen returning bogus values?

Copied from Upfeed forum since this may be more appropriate here...


I'm trying to use the GraphicControl.ProjectPointToScreen(Vector3) method to get the appropriate XY screen location of an object that has been selected in the graphics view, in my case a primitive sphere with local coordinate system at the center.

The function is always returning X=(1/2 graphics window width) or (1/2 graphics window width + 1) (determined by selected object on left or right half of screen) and Y=0.
I have confirmed the Vector3 point I am asking for is correct by using the GraphicControl.ExaminePoint() method, the view immediately focuses on my selected sphere.
I have also tried scaling the Vector3 by various factors of ten, and the results are different, but the desired screen coordinate is never returned.

Has anyone else experienced issues with this method?  Is there some kind of GraphicControl 'update' method i need to call before using ProjectPointToScreen?



  • Johannes Weiman
    edited August 2017
    Hi Levi,

    I have tested and found that it works almost as intended.
    Please note that the returned point is relative to the upper left corner of the graphics window (not the screen). There is however a bug that causes the Y value to be inverted and offset by 1/2 the window height...
    That will be fixed in 6.06. This shows the (corrected) behavior:

    Post edited by Johannes Weiman on
    Johannes Weiman
    Software Engineer
    RobotStudio Team, ABB Robotics
  • Dirka3
    Hi Johannes,

    Thanks for the report!
    I can work around the Y bug until 6.06, that is great that is fixed.

    After your video showed the X value working I tried creating my RobotStudio station from scratch in 6.05.01 and my problem with X returning incorrectly went away running the same add-in code.  The station I previously tested on has been saved/upgraded through several versions of RobotStudio, starting with probably 6.0.  This is just FYI, no further action required.

    Thanks again!