Skip to Content
FASTSUITE E2API ReferencePython APIWorkflowsEvent Scripts

Event Scripts

An event script is a Python file named after the event (e.g., SpeedEvent.py). It lives in the event scripts folder inside the plugin.

When the kernel processes an event, it calls these callbacks:

Callback Chain

Callback → Operator Class Reference

CallbackOperator classPurpose
PostInitAttributesCENPyOlpEvent_AttribInitOperatorCreate/read/write event attributes
PostProcessAttributesCENPyOlpEvent_PEOperatorProcess event attributes
PostComputeCENPyOlpEvent_EventComputeOperatorCustom event computation logic
PostProcessAttributesUploadCENPyOlpEvent_PEOperatorUploadProcess attributes during upload
PostOnAttribChangedCENPyOlpEvent_AttribChangedOperatorReacts to attribute changes

Event Metadata Callbacks

The event script also provides metadata callbacks that return configuration values. These are simple functions with no operator class argument:

CallbackReturn typeDescription
GetEventNamestrDisplay name of the event
GetEventUuIdstrUnique identifier
GetIconNamestrIcon file name
GetGroupNamestrEvent group name
GetEventTypeintEvent type constant
GetMultipleCreationIsPossibleboolAllow multiple instances
IsMachiningCycleboolWhether this is a machining cycle

Typical Pattern

def GetEventName(): return 'MyCustomEvent' def GetEventUuId(): return '{12345678-1234-1234-1234-123456789012}' def PostInitAttributes(eventAttribInitOperator): creator = eventAttribInitOperator.GetAttribCreator() creator.AddDouble('Power', 100.0, 0, 500, 1.0, USER_ATTRIBUTE | PROCESS_ATTRIBUTE, ATTRIB_POWER, 'Power') def PostProcessAttributes(eventPEOperator): getter = eventPEOperator.GetAttribGetter() power = getter.GetDouble('Power') logOp = eventPEOperator.GetLoggerOperator() logOp.LogInfo(f'Processing event with power {power}')
Was this page helpful?