keep part where it is after detachment
chen
✭
in RobotStudio
Hi:
I use Part.Detach() command to detach a part from a mechanism. However, the part always goes back to its original position instead of where it is carried by the mechanism to when it is detached.
Can I somehow keep the part where it is after detachment?
Thanks,
Sam
0
Comments
-
Hi
You need to record the position before you detach and the apply it to your part.
Something like this
// prt is the part you want to attach
//mech is what you attach the part to (in this case a robot)
Matrix4 pos = prt.Transform.GlobalMatrix;
mech.GetFlanges()[0].Detach(prt);
prt.Transform.GlobalMatrix = pos;Per Svensson
Robotics and Vision Specialist
Consat Engineering0 -
Thanks again, Per.
Sam
0 -
Hi,How can I attach an object to a mechanism with an offset to the flange, i.e. I am using
mech.GetFlanges()[0].Attach(prt,true);
Do I use the transform?Shane0 -
I have figured out how to move the flange but when I attach the part it attaches to the original flange coordinates.
mech.GetFlanges()[0].GetFrame().Transform.Y = mech.GetFlanges()[0].GetFrame().Transform.Y + 1;
mech.GetFlanges()[0].Attach(prt, true);Any thoughts?0 -
Basically it works like thisWhen you attach something for example a part to a robot mechanism it will use the part's coordinate system. So if you want to have offset you need to move the body's in the part relative to the part to get an offset.Per Svensson
Robotics and Vision Specialist
Consat Engineering0 -
Alternatively, put the part in a GraphicComponentGroup, offset the part, and attach the group instead.
I'm not sure why Flange.Attach() doesn't have an offset parameter, it's probably something we should fix in the future..
Johannes Weiman
Software Engineer
ABB Robotics0
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