Skip to Content

Teach Handler

Quick Facts

PropertyValue
ClassCENPyOlpTeachHandler
Modulecenpylib.CENPyOlpTeachHandler
Packagecenpylib
ReleaseR2025.2.4
Methods12

Quick Start

# Boilerplate Example teachHandler = ... # obtained from the runtime context result = teachHandler.GetTpElementPosition(tpElement, 0)

Method Index

MethodReturnsSummary
GetTpElementPositionCENPyOlpPositionGet position of the toolpath element.
GetTpElementPositionCENPyOlpPositionGet position of the toolpath element relative to the given base frame, specified by its index.
ModifyTpElementboolApply the current position values to the reference toolpath element.
InsertNewTpElementCENPyOlpTpElementInsert a new toolpath element.
RemoveTpElementRemove the given toolpath element.
SetTpElementNameSet the name of the toolpath element.
SetTpElementMotionTypeSet the new motion type of the toolpath element.
SetTpElementTargetTypeSets the new target type of the underlying toolpath element.
SetTpElementConfigBehaviorSets the config behavior for the given toolpath elements.
SetTpElementTurnBehaviorSets the turn behavior for the given toolpath elements.
RemoveTeachFlagsboolRemoves all teach flags and resets the toolpath element properties to their initial values.
RemoveTeachFlagsboolRemoves the specified teach flags and resets their properties to the initial values.

Query Methods

GetTpElementPosition

def GetTpElementPosition(tpElement: CENPyOlpTpElement, posRelation: int) -> CENPyOlpPosition

Get position of the toolpath element.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementReference toolpath element.
posRelationintRelation of the position.

Returns: CENPyOlpPosition — Toolpath element position.

GetTpElementPosition

def GetTpElementPosition(tpElement: CENPyOlpTpElement, posRelation: int, baseFrameIndex: int) -> CENPyOlpPosition

Get position of the toolpath element relative to the given base frame, specified by its index.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementReference toolpath element.
posRelationintRelation of the position.
baseFrameIndexintBase frame index.

Returns: CENPyOlpPosition — Toolpath element position.

Mutation Methods

ModifyTpElement

def ModifyTpElement(olpPosition: CENPyOlpPosition) -> bool

Apply the current position values to the reference toolpath element. Currently, only an active program is allowed to be modified.

Parameters:

NameTypeDescription
olpPositionCENPyOlpPositionOlp position to take current values from and that holds the reference toolpath element.

Returns: bool — True if modification was successful, False otherwise.

InsertNewTpElement

def InsertNewTpElement(olpPosition: CENPyOlpPosition, motionType: int, insertPosition: int) -> CENPyOlpTpElement

Insert a new toolpath element. Currently, only PTP and LIN motion types can be inserted and only an active program is allowed to be modified.

Parameters:

NameTypeDescription
olpPositionCENPyOlpPositionOlp position of the toolpath element to be created. Olp position also contains reference toolpath element.
motionTypeintMotion type of the toolpath element to be created.
insertPositionintInsert position in relation to the reference toolpath element.

Returns: CENPyOlpTpElement — Newly created toolpath element. None, if failed to insert the new toolpath element.

RemoveTpElement

def RemoveTpElement(toolpathElement: CENPyOlpTpElement)

Remove the given toolpath element. Currently, only an active program is allowed to be modified. Toolpath elements with the process type ProcessInsert, Auxiliary and TeachInsert will be deleted, and all other types will be suppressed.

Parameters:

NameTypeDescription
toolpathElementCENPyOlpTpElementToolpath element to remove.

SetTpElementName

def SetTpElementName(tpElement: CENPyOlpTpElement, name: str)

Set the name of the toolpath element. The Teach Flag for Name will be set.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementReference toolpath element.
namestrNew toolpath element name.

SetTpElementMotionType

def SetTpElementMotionType(tpElement: CENPyOlpTpElement, iMotionType: int)

Set the new motion type of the toolpath element. The Teach Flag for MotionType will be set. If the motion type cannot be set because of restrictions, the element will be skipped.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementReference toolpath element.
iMotionTypeintMotion type to set.

SetTpElementTargetType

def SetTpElementTargetType(tpElement: CENPyOlpTpElement, iTargetType: int)

Sets the new target type of the underlying toolpath element. The Teach Flag for TargetType will be set.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementReference toolpath element.
iTargetTypeintTarget type to set.

SetTpElementConfigBehavior

def SetTpElementConfigBehavior(tpElement: CENPyOlpTpElement, iConfigBehavior: int)

Sets the config behavior for the given toolpath elements. The Teach Flag for Config will be set.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementReference toolpath element.
iConfigBehaviorintConfig behavior to set.

SetTpElementTurnBehavior

def SetTpElementTurnBehavior(tpElement: CENPyOlpTpElement, iTurnBehavior: int)

Sets the turn behavior for the given toolpath elements. The Teach Flag for Turn will be set.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementReference toolpath element.
iTurnBehaviorintTurn behavior to set.

RemoveTeachFlags

def RemoveTeachFlags(tpElement: CENPyOlpTpElement) -> bool

Removes all teach flags and resets the toolpath element properties to their initial values.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementReference toolpath element.

Returns: bool — True if successful, otherwise False.

RemoveTeachFlags

def RemoveTeachFlags(tpElement: CENPyOlpTpElement, teachFlags: int) -> bool

Removes the specified teach flags and resets their properties to the initial values.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementReference toolpath element.
teachFlagsintTeach flags to reset.

Returns: bool — True if successful, otherwise False.

Version Notes

This class is documented as of release R2025.2.4.

Was this page helpful?