RobotStudio event

TemporaryGraphics Questions - GraphicPickPreview and SelectedObjects

Hello,

In my RobotStudio Add-In I am using the TemporaryGraphic feature to represent some of my C# objects, and have two questions regarding the behavior interacting with the temporary graphics.  Note I always have the Pickable property set to true on my temp graphics.
  1. Using the GraphicPicker.GraphicPick event allows me to see if the user has selected my temp graphic in the station view using GraphicPickEventArgs.PickedTemporaryGraphic.  There is a similar event called GraphicPickPreview with the same event args, yet the PickedTemporaryGraphic property is always null (and the PickedObject seems to populate with whatever is behind my temporary graphic in the station view).  Is this to be expected or a problem that could be fixed? I'd like to know when the user is "hovering" the mouse over my temporary graphics.
  2. I'd like to use the GraphicPickEventArgs.CancelSelection property to prevent the current project selection from changing when my temporary graphic is selected in the station view.  I am using this in the GraphicPicker.GraphicPick event handler, but it seems to have no effect and Selection.SelectedObjects is already cleared by the time that event runs.  Is there a different event I should use to get the CancelSelection behvaior I want?  The user will be interacting with RobotStudio geometry/path procedures/instructions while also using my temporary graphics so I do not want to completely turn off project selection updating, I just don't want the current selection to clear when my temporary graphics are clicked. Can this be done?

Thanks for any help you can provide!
-Levi

Comments

  • Hi Levi,
    1. Preview of temporary graphics is not supported currently.
    2. This sounds like a bug. You could possibly work around it by setting GraphicPicker.EnableSelection to false, but I realize that could cause other issues.

    I have logged a request to fix both these issues.
    Regards,
    Johannes
    Johannes Weiman
    Software Engineer
    RobotStudio Team, ABB Robotics