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
- 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)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings