Forum Migration Notice
Update (2026-01-21): The user forums are now in read-only mode pending the data migration.
Update (2026-01-12): The user forums will be put into read-only mode on the 21st of January, 00:00 CET, to prepare for the data migration.
We're transitioning to a more modern community platform by beginning of next year. Learn about the upcoming changes and what to expect.
Update (2026-01-12): The user forums will be put into read-only mode on the 21st of January, 00:00 CET, to prepare for the data migration.
We're transitioning to a more modern community platform by beginning of next year. Learn about the upcoming changes and what to expect.
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.7K RobotStudio
- 402 UpFeed
- 21 Tutorials
- 16 RobotApps
- 307 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 251 ScreenMaker
- 2.9K Robot Controller
- 368 IRC5
- 92 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 859 RAPID Programming
- 43 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 111 Collaborative Robots
- 5 Job listings