RobotStudio event

Macros and Graphics in C#

Hi All!

I am working with VSTA programming a macro that makes an object disappear by becoming more and more transparent, and then a new object appears becoming less transparent in the same place :)

I have a problem because I have to repeat this procedure in different phases with different objects, and it is getting complicated.

I am using TemporaryGraphics because it is the only way I found to draw and object with transparency, but they have lots of limitations, for example I cannot remove only one, so I cannot make it disappear...

Is there a better way to do this? Can I add transparency to one part?

Thank you very much in advance for your ideas and help!image

Best regards,

Anna

 

 

Best Regards,

Anna

Comments

  • Hi Anna!

    Have you tried to remove a temporary graphics objects like this?


    Station
    s; Part p;
    TemporaryGraphic tempGfx = s.TemporaryGraphics.DrawPart(Matrix4.Identity, p);
    s.TemporaryGraphics.Remove(tempGfx);
    Best Regards
    Niklas Skoglund
     

    Best Regards, Niklas Skoglund
    ABB Robotics

    Developer Center
    RobotStudio Blog
  • Hi Niklas!image

    Thank you very much for your help, I think I can see the problem now, but I don't know how to solve it yet! image

    I was working with GraphicComponents because I cannot create/declare a TemporaryGraphic as you do in your example, it is not a reserved word (it does not appear in the list and it does not turn blue) maybe I have to use another reference? image

    Anna

     

    Best Regards,

    Anna
  • Ok I've got it!

    I had to add:


    using
    ABB.Robotics.RobotStudio.Stations.Forms;

    I used the object browser to see where the TemporaryGraphics were, I'd had never thought that I was missing something, because I was using already the TemporaryGraphics...

    Thanks again Niklas!

    Best regards,

    Anna

     

     

    Best Regards,

    Anna