VB create part in RS ( VSTA)
in RobotStudio
Hi
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))
pt.Bodies.Add(b1)
End Sub
________________________________________________________________
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
________________________________________________________________
Regards
Knud Erik Lindberg
Jorgensen Engineering
Knud Erik Lindberg
Jorgensen Engineering
0
Comments
-
HiFound it:
size = New Vector3(0, 0, 0)
matrix_origo = New Matrix4(size)Regards
Knud Erik Lindberg
Jorgensen Engineering0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 786 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings