Teach Handler
Quick Facts
| Property | Value |
|---|---|
| Class | CENPyOlpTeachHandler |
| Module | cenpylib.CENPyOlpTeachHandler |
| Package | cenpylib |
| Release | R2025.2.4 |
| Methods | 12 |
Quick Start
# Boilerplate Example
teachHandler = ... # obtained from the runtime context
result = teachHandler.GetTpElementPosition(tpElement, 0)Method Index
| Method | Returns | Summary |
|---|---|---|
GetTpElementPosition | CENPyOlpPosition | Get position of the toolpath element. |
GetTpElementPosition | CENPyOlpPosition | Get position of the toolpath element relative to the given base frame, specified by its index. |
ModifyTpElement | bool | Apply the current position values to the reference toolpath element. |
InsertNewTpElement | CENPyOlpTpElement | Insert a new toolpath element. |
RemoveTpElement | — | Remove the given toolpath element. |
SetTpElementName | — | Set the name of the toolpath element. |
SetTpElementMotionType | — | Set the new motion type of the toolpath element. |
SetTpElementTargetType | — | Sets the new target type of the underlying toolpath element. |
SetTpElementConfigBehavior | — | Sets the config behavior for the given toolpath elements. |
SetTpElementTurnBehavior | — | Sets the turn behavior for the given toolpath elements. |
RemoveTeachFlags | bool | Removes all teach flags and resets the toolpath element properties to their initial values. |
RemoveTeachFlags | bool | Removes the specified teach flags and resets their properties to the initial values. |
Query Methods
GetTpElementPosition
def GetTpElementPosition(tpElement: CENPyOlpTpElement, posRelation: int) -> CENPyOlpPositionGet position of the toolpath element.
Parameters:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Reference toolpath element. |
posRelation | int | Relation of the position. |
Returns: CENPyOlpPosition — Toolpath element position.
GetTpElementPosition
def GetTpElementPosition(tpElement: CENPyOlpTpElement, posRelation: int, baseFrameIndex: int) -> CENPyOlpPositionGet position of the toolpath element relative to the given base frame, specified by its index.
Parameters:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Reference toolpath element. |
posRelation | int | Relation of the position. |
baseFrameIndex | int | Base frame index. |
Returns: CENPyOlpPosition — Toolpath element position.
Mutation Methods
ModifyTpElement
def ModifyTpElement(olpPosition: CENPyOlpPosition) -> boolApply the current position values to the reference toolpath element. Currently, only an active program is allowed to be modified.
Parameters:
| Name | Type | Description |
|---|---|---|
olpPosition | CENPyOlpPosition | Olp 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) -> CENPyOlpTpElementInsert 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:
| Name | Type | Description |
|---|---|---|
olpPosition | CENPyOlpPosition | Olp position of the toolpath element to be created. Olp position also contains reference toolpath element. |
motionType | int | Motion type of the toolpath element to be created. |
insertPosition | int | Insert 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:
| Name | Type | Description |
|---|---|---|
toolpathElement | CENPyOlpTpElement | Toolpath 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:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Reference toolpath element. |
name | str | New 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:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Reference toolpath element. |
iMotionType | int | Motion 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:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Reference toolpath element. |
iTargetType | int | Target 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:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Reference toolpath element. |
iConfigBehavior | int | Config 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:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Reference toolpath element. |
iTurnBehavior | int | Turn behavior to set. |
RemoveTeachFlags
def RemoveTeachFlags(tpElement: CENPyOlpTpElement) -> boolRemoves all teach flags and resets the toolpath element properties to their initial values.
Parameters:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Reference toolpath element. |
Returns: bool — True if successful, otherwise False.
RemoveTeachFlags
def RemoveTeachFlags(tpElement: CENPyOlpTpElement, teachFlags: int) -> boolRemoves the specified teach flags and resets their properties to the initial values.
Parameters:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Reference toolpath element. |
teachFlags | int | Teach flags to reset. |
Returns: bool — True if successful, otherwise False.
Related Types
Version Notes
This class is documented as of release R2025.2.4.