Skip to main content
Skip table of contents

Sample Code - Calulate Offset()

CaloffsetPos()

PY
# Calulate Offset
def CaloffsetPos(ref_Pos, offset_Dist, offset_Frame, ref_Frame):
    # Input data (Example): 
    # ref_Pos = posx(X, Y, Z, A, B, C)
    # offset_Dist = [X, Y, Z]
    # offset_Frame = DR_TOOL
    # ref_Frame = DR_BASE 
    pos_Trans = posx(0,0,0,0,0,0)
    if ref_Frame == DR_BASE or ref_Frame == DR_TOOL:
        pos_Trans = trans(ref_Pos, [offset_Dist[0], offset_Dist[1], offset_Dist[2], 0, 0, 0], offset_Frame, DR_BASE)
    else:
        pos_Trans = trans(ref_Pos, [offset_Dist[0], offset_Dist[1], offset_Dist[2], 0, 0, 0], offset_Frame, ref_Frame)
    return pos_Trans
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.