Python scripting OLP - Objects

CENPyOlpPosition

 

Methods

 

X(): float

 

o

return

X coordinate in meters

 

Get X coordinate.

 

[Example]

   olpPosition = teachHandler.GetTpElementPosition(tpElement, POSRELATION_BASEFRAME)

   xValue = olpPosition.X()

 


 

Y(): float

 

o

return

Y coordinate in meters

 

Get y coordinate.

 

[Example]

   olpPosition = teachHandler.GetTpElementPosition(tpElement, POSRELATION_BASEFRAME)

   yValue = olpPosition.Y()

 


 

Z(): float

 

o

return

Z coordinate in meters

 

Get z coordinate.

 

 [Example]

   olpPosition = teachHandler.GetTpElementPosition(tpElement, POSRELATION_BASEFRAME)

   zValue = olpPosition.Z()

 


 

RX(): float

 

o

return

RX orientation in degrees

 

Get RX orientation.

 

[Example]

   olpPosition = teachHandler.GetTpElementPosition(tpElement, POSRELATION_BASEFRAME)

   rxValue = olpPosition.RX()

 


 

RY(): float

 

o

return

RY orientation in degrees

 

Get RY orientation.

 

[Example]

   olpPosition = teachHandler.GetTpElementPosition(tpElement, POSRELATION_BASEFRAME)

   ryValue = olpPosition.RY()

 


 

RZ(): float

 

o

return

RZ orientation in degrees

 

Get RZ orientation.

 

 [Example]

   olpPosition = teachHandler.GetTpElementPosition(tpElement, POSRELATION_BASEFRAME)

   rzValue = olpPosition.RZ()

 


 

GetCoordinates(): list

 

o

return

List with X, Y and Z coordinates in meters

 

Get toolpath element coordinates in a list.

 

[Example]

   coordinates = olpPosition.GetCoordinates()

 


 

 

SetCoordinates(x: float, y: float, z: float)

 

o

x

x coordinate in meters

 

o

y

y coordinate in meters

 

o

z

z coordinate in meters

 

Set toolpath element coordinates.

 

[Example]

   olpPosition.SetCoordinates(-1, 2.2, 3)

 


 

SetCoordinates([x: float, y: float, z: float])

 

o

x

x coordinate in meters

 

o

y

y coordinate in meters

 

o

z

z coordinate in meters

 

Set toolpath element coordinates using a list.

 

[Example]

   olpPosition.SetCoordinates([-1, 2.2, 3])

 


 

GetViaPointCoordinates(): list

 

o

return

List with X, Y and Z coordinates in meters

 

Get Via point coordinates in a list.

 

[Example]

   coordinates = olpPosition.GetViaPointCoordinates()

 


 

 

SetViaPointCoordinates(x: float, y: float, z: float)

 

o

x

x coordinate in meters

 

o

y

y coordinate in meters

 

o

z

z coordinate in meters

 

Set Via point coordinates.

 

[Example]

   olpPosition.SetViaPointCoordinates(-1, 2.2, 3)

 


 

SetViaPointCoordinates([x: float, y: float, z: float])

 

o

x

x coordinate in meters

 

o

y

y coordinate in meters

 

o

z

z coordinate in meters

 

Set Via point coordinates using a list.

 

[Example]

   olpPosition.SetViaPointCoordinates([-1, 2.2, 3])

 


 

GetOrientation(): list

 

o

return

List with RX, RY and RZ orientations in degrees

 

Get toolpath element orientations in a list.

 

[Example]

   coordinates = olpPosition.GetOrientation()

 


 

 

SetOrientation(rx: float, ry: float, rz: float)

 

o

rx

RX orientation in degrees

 

o

ry

RY orientation in degrees

 

o

rz

RZ orientation in degrees

 

Set toolpath element orientations.

 

[Example]

   olpPosition.SetOrientation(10, 15, 30)

 


 

SetOrientation([rx: float, ry: float, rz: float])

 

o

rx

RX orientation in degrees

 

o

ry

RY orientation in degrees

 

o

rz

RZ orientation in degrees

 

Set toolpath element orientations using a list.

 

[Example]

   olpPosition.SetOrientation([10, 15, 30])

 


 

GetRefTpElement(): CENPyOlpTpElement

 

o

return

Object of CENPyOlpTpElement class

 

Get the reference toolpath element stored in CENPyOlpPosition class.

 

[Example]

   refTpe = olpPosition.GetRefTpElement()

 


 

SetRefTpElement(refTpe: CENPyOlpTpElement)

 

o

refTpe

Object of CENPyOlpTpElement class

 

Set the reference toolpath element in CENPyOlpPosition class.

 

[Example]

    olpPosition.SetRefTpElement(refTpe)

 


 

GetPositionRelation(): PosRelation

 

o

return

Enum value of the PosRelation

 

Get the current relation of the position.

 

[Example]

   posRelation = olpPosition.GetPositionRelation()

 


 

SetPositionRelation(posRel: PosRelation)

 

o

posRel

Enum value of the PosRelation

 

Set the new relation for the position.

 

[Example]

    olpPosition.SetPositionRelation(POSRELATION_WORKPIECEROOT)

 


 

SetPositionRelation(posRel: PosRelation, baseFrameIndex: int)

 

o

posRel

Enum value of the PosRelation. In this case it should be POSRELATION_BASEFRAME

 

o

baseFrameIndex

Base frame index to set. The default value is the index of an active base frame

 

Set the position relation to Base frame and the base frame index.

 

[Example]

    olpPosition.SetPositionRelation(POSRELATION_BASEFRAME) #Index of an active base frame used

or

    olpPosition.SetPositionRelation(POSRELATION_BASEFRAME, 1)

 


 

GetMatrix(): CENPyOlpMatrix

 

o

return

Toolpath element matrix

Get the represented toolpath element matrix. The matrix will always represent the current PosRelation

 

[Example]

   tpeMatrix = olpPosition.GetMatrix()

 


   

GetViaPointMatrix(): CENPyOlpMatrix

 

o

return

Toolpath element matrix

Get the represented Via point matrix. The matrix will always represent the current PosRelation

 

[Example]

   viaMatrix = olpPosition.GetViaPointMatrix()

 


 

TranslatePosition(x: float, y: float, z: float, posRel: PosRelation)

 

o

x

Direction in local X in meters

 

o

y

Direction in local Y in meters

 

o

z

Direction in local Z in meters

 

o

posRel

Position relation the local translation should be done in

 

Translates the toolpath element position locally in given direction.

 

[Example]

   olpPosition.TranslatePosition(0.1, 0, 0.1, POSRELATION_WORKPIECEROOT)

 


 

TranslatePosition(x: float, y: float, z: float, posRel: PosRelation, baseFrameIndex: int)

 

o

x

Direction in local X in meters

 

o

y

Direction in local Y in meters

 

o

z

Direction in local Z in meters

 

o

posRel

Position relation the local translation should be done in

 

o

baseFrameIndex

Index of the base frame to be used for translation. The default value is the index of an active base frame

 

Translates the toolpath element position locally in given direction relative to the base frame, specified by its index.

 

[Example]

   olpPosition.TranslatePosition(0, 0, 0.1, POSRELATION_BASEFRAME) #Index of an active base frame used

or 

   olpPosition.TranslatePosition(0, 0, 0.1, POSRELATION_BASEFRAME, 2)

 


 

TranslateViaPointPosition(x: float, y: float, z: float, posRel: PosRelation)

 

o

x

Direction in local X in meters

 

o

y

Direction in local Y in meters

 

o

z

Direction in local Z in meters

 

o

posRel

Position relation the local translation should be done in

 

Translates the Via point position locally in given direction.

 

[Example]

   olpPosition.TranslateViaPointPosition(0.1, 0, 0.1, POSRELATION_WORKPIECEROOT)

 


 

TranslateViaPointPosition(x: float, y: float, z: float, posRel: PosRelation, baseFrameIndex: int)

 

o

x

Direction in local X in meters

 

o

y

Direction in local Y in meters

 

o

z

Direction in local Z in meters

 

o

posRel

Position relation the local translation should be done in

 

o

baseFrameIndex

Index of the base frame to be used for translation. The default value is the index of an active base frame

 

Translates the Via point position locally in given direction relative to the base frame, specified by its index.

 

[Example]

   olpPosition.TranslateViaPointPosition(0, 0, 0.1, POSRELATION_BASEFRAME) #Index of an active base frame used

or 

   olpPosition.TranslateViaPointPosition(0, 0, 0.1, POSRELATION_BASEFRAME, 2)

 


   

RotatePosition(rx: float, ry: float, rz: float, posRel: PosRelation)

 

o

rx

Rotation around local X in degrees

 

o

ry

Rotation around local Y in degrees

 

o

rz

Rotation around local Z in degrees

 

o

posRel

Position relation the local translation should be done in

 

Rotates the position locally around given direction.

 

[Example]

   olpPosition.RotatePosition(0, 0, -45, POSRELATION_LOCALTOOLPATHELEMENT)

 


 

RotatePosition(rx: float, ry: float, rz: float, posRel: PosRelation, baseFrameIndex: int)

 

o

rx

Rotation around local X in degrees

 

o

ry

Rotation around local Y in degrees

 

o

rz

Rotation around local Z in degrees

 

o

posRel

Position relation the local translation should be done in

 

o

baseFrameIndex

Index of the base frame to be used for translation. The default value is the index of an active base frame

 

Rotates the position locally around given direction relative to the base frame, specified by its index.

 

[Example]

   olpPosition.RotatePosition(11, 22, 33, POSRELATION_BASEFRAME) #Index of an active base frame used

or 

   olpPosition.RotatePosition(11, 22, 33, POSRELATION_BASEFRAME, 3)

 


 

GetViaPointName(): string

 

 

o

return

Via point name

 

Get the name of the Via point if it exists, None otherwise.

 

[Example]

   viaPointName = olpPosition.GetViaPointName()

 


 

 

GetJointValues(): list

 

o

return

List with joint values in degrees

 

Get all toolpath element joint values in a list.

 

[Example]

   jointValues = olpPosition.GetJointValues()

 


 

 

SetJointValues([j1: float, j2: float,.. jn: float])

 

o

j1

Value of the first joint in degrees

 

o

j2

Value of the second joint in degrees

 

o

jn

Value of the n joint in degrees

 

Set all toolpath element joint values using a list.

 

[Example]

   jointValues = olpPosition.GetJointValues()

   jointValues[0] = -10

   jointValues[3] = 45

   olpPosition.SetJointValues(jointValues)

 


 

GetExternalJointValues(): list

 

o

return

List with joint values in degrees

 

Get all toolpath element external joint values in a list.

 

[Example]

   extJointValues = olpPosition.GetExternalJointValues()

 


 

 

SetExternalJointValues([e1: float, e2: float,.. en: float])

 

o

e1

Value of the first external joint in degrees

 

o

e2

Value of the second external joint in degrees

 

o

en

Value of the n external joint in degrees

 

Set all toolpath element external joint values using a list.

 

[Example]

   extJointValues = olpPosition.GetExternalJointValues()

   extJointValues[0] = 0.135

   extJointValues[1] = -10

   olpPosition.SetExternalJointValues(extJointValues)

 


 

 


Previous
Page précédente
Chapter
Page principale du chapitre
Next
Page suivante