# Mirror

**URL:** <https://tech-community.robotics.abb.com/t/mirror/98>\
**Category:** RobotStudio S4\
**Created:** [November 26, 2003, 5:44pm UTC](https://tech-community.robotics.abb.com/t/mirror/98 "2003-11-26T17:44:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_J](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@Thomas\_J](https://tech-community.robotics.abb.com/u/Thomas_J)\
**Post date:** [November 26, 2003, 5:44pm UTC](https://tech-community.robotics.abb.com/t/mirror/98/1 "2003-11-26T17:44:59Z")

</div>

How do you mirror an entity or part thru VBA - API?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/system/32/6_2.png) [@system](https://tech-community.robotics.abb.com/u/system)\
**Post date:** [November 27, 2003, 1:26pm UTC](https://tech-community.robotics.abb.com/t/mirror/98/2 "2003-11-27T13:26:11Z")

</div>

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
