Event Handler
Quick Facts
| Property | Value |
|---|---|
| Class | CENPyOlpEventHandler |
| Module | cenpylib.CENPyOlpEventHandler |
| Package | cenpylib |
| Release | R2025.2.4 |
| Methods | 9 |
Quick Start
# Boilerplate Example
# Acquire the event object from the runtime context
eventHandler = ... # provided by the frameworkMethod Index
| Method | Returns | Summary |
|---|---|---|
GetEventsByName | list[CENPyOlpEventObject] | Get all existing Olp events with the specified name on the given toolpath element. |
GetRuleBasedEventsByName | list[CENPyOlpEventObject] | Get all existing rule-based Olp events with the specified name on the given toolpath element. |
GetBuiltInEventsByType | list | Get all existing Built-in events with the specified type on the given toolpath element. |
GetAllRuleBasedEvents | list | Get all existing rule-based Olp events on the given toolpath element. |
GetAllNonRuleBasedEvents | list | Get all existing Olp events, not added by a Rule, on the given toolpath element. |
AddEventByName | CENPyOlpEventObject | Add a new Olp event on the given toolpath element. |
AddBuiltInEventByType | Any | Add a new Built-in event on the given toolpath element. |
RemoveEvent | — | Remove the given Olp event from the specified toolpath element. |
RemoveBuiltInEvent | — | Remove Built-in event from the given toolpath element. |
Query Methods
GetEventsByName
def GetEventsByName(tpElement: CENPyOlpTpElement, eventName: str) -> list[CENPyOlpEventObject]Get all existing Olp events with the specified name on the given toolpath element.
Parameters:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Toolpath element to check for events. |
eventName | str | Event name to search for. |
Returns: list[CENPyOlpEventObject] — List of CENPyOlpEventObject objects, found events.
GetRuleBasedEventsByName
def GetRuleBasedEventsByName(tpElement: CENPyOlpTpElement, eventName: str) -> list[CENPyOlpEventObject]Get all existing rule-based Olp events with the specified name on the given toolpath element.
Parameters:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Toolpath element to check for events. |
eventName | str | Event name to search for. |
Returns: list[CENPyOlpEventObject] — List of CENPyOlpEventObject objects, found events.
GetBuiltInEventsByType
def GetBuiltInEventsByType(tpElement: CENPyOlpTpElement, iEventType: int) -> listGet all existing Built-in events with the specified type on the given toolpath element.
Parameters:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Toolpath element to check for events |
iEventType | int | Event type to search for. |
Returns: list — List of objects, found events.
GetAllRuleBasedEvents
def GetAllRuleBasedEvents(tpElement: CENPyOlpTpElement) -> listGet all existing rule-based Olp events on the given toolpath element.
Parameters:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Toolpath element to check for events. |
Returns: list — Number of found events.
GetAllNonRuleBasedEvents
def GetAllNonRuleBasedEvents(tpElement: CENPyOlpTpElement) -> listGet all existing Olp events, not added by a Rule, on the given toolpath element.
Parameters:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Toolpath element to check for events. |
Returns: list — Number of found events.
Mutation Methods
AddEventByName
def AddEventByName(tpElement: CENPyOlpTpElement, eventName: str, iInsertPosition: int) -> CENPyOlpEventObjectAdd a new Olp event on the given toolpath element.
Parameters:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Toolpath element on which to add a new event. |
eventName | str | Name of the event to add. |
iInsertPosition | int | Insert position. “Inherit” is not supported because there is no parent event. |
Returns: CENPyOlpEventObject — Newly added event.
AddBuiltInEventByType
def AddBuiltInEventByType(tpElement: CENPyOlpTpElement, iEventType: int, iInsertPosition: int) -> objectAdd a new Built-in event on the given toolpath element.
Parameters:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Toolpath element on which to add a new event. |
iEventType | int | Type of the event to add. |
iInsertPosition | int | Insert position. “Inherit” is not supported because there is no parent event. |
Returns: Any — Newly added event.
RemoveEvent
def RemoveEvent(tpElement: CENPyOlpTpElement, event: CENPyOlpEventObject)Remove the given Olp event from the specified toolpath element.
Parameters:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Toolpath element to remove event from. |
event | CENPyOlpEventObject | Event to remove. |
RemoveBuiltInEvent
def RemoveBuiltInEvent(tpElement: CENPyOlpTpElement, event: object)Remove Built-in event from the given toolpath element.
Parameters:
| Name | Type | Description |
|---|---|---|
tpElement | CENPyOlpTpElement | Toolpath element to remove event from. |
event | Any | Built-in event to remove. |
Related Types
Version Notes
This class is documented as of release R2025.2.4.