# VB create part in RS ( VSTA)

**URL:** <https://tech-community.robotics.abb.com/t/vb-create-part-in-rs-vsta/2340>\
**Category:** RobotStudio\
**Created:** [December 2, 2008, 10:58am UTC](https://tech-community.robotics.abb.com/t/vb-create-part-in-rs-vsta/2340 "2008-12-02T10:58:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Knud\_E\_Lindberg](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/knud_e_lindberg/32/4450_2.png) [@Knud\_E\_Lindberg](https://tech-community.robotics.abb.com/u/Knud_E_Lindberg)\
**Post date:** [December 2, 2008, 10:58am UTC](https://tech-community.robotics.abb.com/t/vb-create-part-in-rs-vsta/2340/1 "2008-12-02T10:58:17Z")

</div>

Hi

I have a problem with this tow line.  
matrix\_origo = New Matrix4(New Vector3(0, 0, 0))

b1 = Body.CreateSolidBox(matrix\_origo, size)

VB code

* * *

Public Sub Macro\_CreateSolidBox()

Dim stn As Station

Dim pt As Part

Dim matrix\_origo As Matrix4

Dim b1 As Body

Dim size As Vector3

Dim x As Double

’ TODO: Define actions to perform when the Macro is invoked.

Logger.AddMessage(New LogMessage("log: " & “Create solid box”))

'get the station object

stn = Project.ActiveProject

'Create a part to contain the solid body

pt = New Part()

pt.Name = “OurPart”

stn.GraphicComponents.Add(pt)

'Create a solid box.

x = 0

matrix\_origo = New Matrix4(New Vector3(0, 0, 0))

size = New Vector3(0.3, 0.4, 0.5)

b1 = Body.CreateSolidBox(matrix\_origo, size)

b1.Name = “OurBox”

pt.Bodies.Add(b1)

End Sub

* * *

---

<div class="post-metadata">

**Author:** ![Knud\_E\_Lindberg](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/knud_e_lindberg/32/4450_2.png) [@Knud\_E\_Lindberg](https://tech-community.robotics.abb.com/u/Knud_E_Lindberg)\
**Post date:** [December 2, 2008, 11:27am UTC](https://tech-community.robotics.abb.com/t/vb-create-part-in-rs-vsta/2340/2 "2008-12-02T11:27:04Z")

</div>

Hi  
Found it:

size = New Vector3(0, 0, 0)

matrix\_origo = New Matrix4(size)
