
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.5K RobotStudio
- 398 UpFeed
- 19 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 324 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 813 RAPID Programming
- 5 AppStudio
- 3 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings