Visual Studio. Create body and attach it to positioner

Vlad222
✭
in RobotStudio
Hi everyone!
I want to use VSTA to create object and attach it to positioner. I created body. How can I attach it to IRBP A (using code)?
I want to use VSTA to create object and attach it to positioner. I created body. How can I attach it to IRBP A (using code)?
I think I need add only one line like:
*******.Attach(p, true, new Matrix4(new Vector3(0.0, 0.0, 1.0)));
My code:
public void Macro_Sample1()
{
Project.UndoContext.BeginUndoStep("BodyCreateSolids");
try
{
Station station = Project.ActiveProject as Station;
Mechanism mech = station.ActiveTask.Mechanism;
Part p = new Part();
p.Name = "My_Solid_Bodies";
station.GraphicComponents.Add(p);
// Create a cylinder.
Matrix4 matrix_origo1 = new Matrix4(new Vector3(Axis.X), 0.0);
Vector3 size1 = new Vector3(0.500, 0.500, 0.500);
Body b1 = Body.CreateSolidCylinder(matrix_origo1, 0.5, 0.5);
b1.Name = "Cylinder1";
p.Bodies.Add(b1);
}
catch {}
finally {}
}
0
Categories
- All Categories
- 5.6K RobotStudio
- 399 UpFeed
- 20 Tutorials
- 14 RobotApps
- 301 PowerPacs
- 406 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 336 IRC5
- 67 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 828 RAPID Programming
- 13 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 107 Collaborative Robots
- 5 Job listings