RobotStudio event

Offset workobject

Options
Whats the easiest way to offset the x,y,z of a work object?

Comments

  • scottMHA
    Options
    found the solution --> workobject.trans.x = X;
  • lemster68
    lemster68 ✭✭✭
    Options
    Is it a permanent offset or temporary?  Most of the time, in the case of temporary, like vision guidance, I would apply the offset to the Oframe, not the UFrame.
    Lee Justice
  • How to use that temporary workobject... what is its syntax?
  • veritas
    veritas
    edited March 2019
    Options
    How to use that temporary workobject... what is its syntax?
    workobject.oframe.trans.x := X;

    OR

    workobject.oframe.trans := [X,Y,Z];
  • Rickytre91
    Options
    so this won't permanently change the work object data?
  • veritas
    Options
    so this won't permanently change the work object data?
    No, the userframe will stay the same, you will only update the objectframe. If needed, you can set your oframe to the same values as uframe at any time.
  • lemster68
    lemster68 ✭✭✭
    Options
    These solutions WILL permanently offset the workobject as a WHOLE.  If you want to use a temporary offset, then assign the permanent wobj values to another variable workobject.  Example:
    WobjTemp:=WobjPermanent;
    WobjTemp.oframe.trans.z:=100; ! or whatever you need to change
    Lee Justice
  • veritas
    Options
    lemster68 said:
    These solutions WILL permanently offset the workobject as a WHOLE.  If you want to use a temporary offset, then assign the permanent wobj values to another variable workobject.  Example:
    WobjTemp:=WobjPermanent;
    WobjTemp.oframe.trans.z:=100; ! or whatever you need to change
    I usually assign the workobjekt to a temporary myself and would recommend it too avoid mistakes. I understood Rickytre91's question as if he was wondering wether the origin of the workobjekt would change or not. It will off course be offseted, but clearing the oframe will get it back to it's original value.