RobotStudio event

Add-In tab removed from ribbon when closing a PowerPac

Hello,

I'm developing a RobotStudio add-in. I add a tab to the ribbon when my add-in starts up. I've found that if I also start ArcWelding PowerPac or Machining PowerPac, then press the close button in the top bar, it removes my tab from the ribbon.

Is this the expected behavior? Is there any way to keep my tab in the ribbon when closing a PowerPac?

Thank you for the help.

Comments

  • Hi,

    All non-standard tabs are set to invisible when a PowerPac is closed.
    This piece of code should fix the problem:

    CommandBarButton.FromID("DeactivatePowerPac").ExecuteCommand += (s, e) => UIEnvironment.RibbonTabs["MyTab"].Visible = true;

    Regards,
    Johannes
    Johannes Weiman
    Software Engineer
    RobotStudio Team, ABB Robotics
  • Hi Johannes,

    Thank you for the quick response. I am not able to get the event handler to execute when the DeactivatePowerPac button is pressed. I tried adding event handlers to the other events (UpdateCommandUI and TrackCommandBarControl) on that CommandBarButton, but none of them seem to execute.

    Am I trying to attach to the events incorrectly?

    I can see the event come through If I add an event handler to UIEnvironment.ExecutedCommand. I can then check if the control's ID is DeactivatePowerPac and set my tab to visible again. The downside to this is that I have to filter out all the events that aren't relevant.

    Thank you,
    sehe



  • Sorry about that, I forgot that ExecuteCommand etc are a bit nonstandard as they are only sent to one subscriber. But I think ExecutedCommand is a good alternative in this case.

    Regards,
    Johannes
    Johannes Weiman
    Software Engineer
    RobotStudio Team, ABB Robotics