RobotStudio event

Mirror

How do you mirror an entity or part thru VBA - API?
Thomas H. Johnston
PACs Application Engineer

Comments

  • Hello Thomas,

    There is a function in RobotStudio called mirror (you find it in the Modify menu); one way to call it could be to run the following macro from RobotStudio (will not work to run from inside VBA).

     


    Sub Mirror()
    Dim tfmTransform As New Transform
    tfmTransform.x = 2.5
    tfmTransform.y = 2.5
    Dim prtPart As Part
    Set prtPart = ActiveStation.Parts.Add
    Dim entBox As Entity
    Set entBox = prtPart.CreateSolidBox(tfmTransform, 0.5, 0.5, 0.5)
    ActiveStation.Selections.RemoveAll
    ActiveStation.Selections.Add entBox
    Application.RSE.CommandBars("Menu Bar").Controls("Modify").Controls("Mirror...").Execute
    SendKeys "100{TAB}100{TAB}{TAB}1000{TAB}1000{TAB}{TAB}{TAB}{TAB}1000{ENTER}"
    End Sub
     
    Good luck!
    /Ulrika
    Ulrika Mor?n37952,5661574074