Work Method Scripts
A work method script is a Python file named after the work method (e.g., ArcWeldWM.py).
It lives in the work method scripts folder inside the plugin.
When the kernel processes a work method, it calls these callbacks in order:
Callback Chain
Callback → Operator Class Reference
| Callback | Operator class | Purpose |
|---|---|---|
| PostWmInitAttributes | CENPyOlpWM_AttribInitOperator | Create/read/write work method attributes |
| PostWmInitEvents | CENPyOlpWM_EventInitOperator | Register work method events |
| PostWmInitRules | CENPyOlpWM_RuleInitOperator | Register work method rules |
| PostWmSyncPgAttributes | CENPyOlpWM_SyncPgAttribOperator | Synchronize process geometry attributes |
| PostProcessOperationAttributes | CENPyOlpWM_POAttribOperator | Read/write per-operation attributes |
| PostWmOnAttribChanged | CENPyOlpWM_AttribChangedOperator | Reacts to attribute changes |
| PostWmOnFrameChanged | CENPyOlpFrameChangedOperator | Reacts to frame changes |
Typical Pattern
def PostWmInitAttributes(wmAttribInitOperator):
creator = wmAttribInitOperator.GetAttribCreator()
creator.AddDouble('Offset', 0.0, -50, 50, 0.1,
USER_ATTRIBUTE | OPERATION_ATTRIBUTE, ATTRIB_LENGTH, 'Offset')
def PostProcessOperationAttributes(wmPOAttribOperator):
getter = wmPOAttribOperator.GetAttribGetter()
offset = getter.GetDouble('Offset')
logOp = wmPOAttribOperator.GetLoggerOperator()
logOp.LogInfo(f'Processing operation with offset {offset}')Was this page helpful?