Skip to Content

Event Handler

Quick Facts

PropertyValue
ClassCENPyOlpEventHandler
Modulecenpylib.CENPyOlpEventHandler
Packagecenpylib
ReleaseR2025.2.4
Methods9

Quick Start

# Boilerplate Example # Acquire the event object from the runtime context eventHandler = ... # provided by the framework

Method Index

MethodReturnsSummary
GetEventsByNamelist[CENPyOlpEventObject]Get all existing Olp events with the specified name on the given toolpath element.
GetRuleBasedEventsByNamelist[CENPyOlpEventObject]Get all existing rule-based Olp events with the specified name on the given toolpath element.
GetBuiltInEventsByTypelistGet all existing Built-in events with the specified type on the given toolpath element.
GetAllRuleBasedEventslistGet all existing rule-based Olp events on the given toolpath element.
GetAllNonRuleBasedEventslistGet all existing Olp events, not added by a Rule, on the given toolpath element.
AddEventByNameCENPyOlpEventObjectAdd a new Olp event on the given toolpath element.
AddBuiltInEventByTypeAnyAdd a new Built-in event on the given toolpath element.
RemoveEventRemove the given Olp event from the specified toolpath element.
RemoveBuiltInEventRemove 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:

NameTypeDescription
tpElementCENPyOlpTpElementToolpath element to check for events.
eventNamestrEvent 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:

NameTypeDescription
tpElementCENPyOlpTpElementToolpath element to check for events.
eventNamestrEvent name to search for.

Returns: list[CENPyOlpEventObject] — List of CENPyOlpEventObject objects, found events.

GetBuiltInEventsByType

def GetBuiltInEventsByType(tpElement: CENPyOlpTpElement, iEventType: int) -> list

Get all existing Built-in events with the specified type on the given toolpath element.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementToolpath element to check for events
iEventTypeintEvent type to search for.

Returns: list — List of objects, found events.

GetAllRuleBasedEvents

def GetAllRuleBasedEvents(tpElement: CENPyOlpTpElement) -> list

Get all existing rule-based Olp events on the given toolpath element.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementToolpath element to check for events.

Returns: list — Number of found events.

GetAllNonRuleBasedEvents

def GetAllNonRuleBasedEvents(tpElement: CENPyOlpTpElement) -> list

Get all existing Olp events, not added by a Rule, on the given toolpath element.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementToolpath element to check for events.

Returns: list — Number of found events.

Mutation Methods

AddEventByName

def AddEventByName(tpElement: CENPyOlpTpElement, eventName: str, iInsertPosition: int) -> CENPyOlpEventObject

Add a new Olp event on the given toolpath element.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementToolpath element on which to add a new event.
eventNamestrName of the event to add.
iInsertPositionintInsert 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) -> object

Add a new Built-in event on the given toolpath element.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementToolpath element on which to add a new event.
iEventTypeintType of the event to add.
iInsertPositionintInsert 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:

NameTypeDescription
tpElementCENPyOlpTpElementToolpath element to remove event from.
eventCENPyOlpEventObjectEvent to remove.

RemoveBuiltInEvent

def RemoveBuiltInEvent(tpElement: CENPyOlpTpElement, event: object)

Remove Built-in event from the given toolpath element.

Parameters:

NameTypeDescription
tpElementCENPyOlpTpElementToolpath element to remove event from.
eventAnyBuilt-in event to remove.

Version Notes

This class is documented as of release R2025.2.4.

Was this page helpful?