Python scripting - Workmethod operators

CENPyOlpWM_RuleInitOperator

 

The object of the CENPyOlpWM_RuleInitOperator class is passed to the PostTechInitRules callback as a parameter.

It can be used to obtain the required operators within the scope of the PostTechInitRules callback in the %WORK_METHOD%.py script file, located in the folder of the plugin.

 

[Example]

 

def PostWmInitRules(wmRuleInitOperator):

 

Methods

 

AddPyEvent(ruleName: string, pyEventName: string): CENPyOlpEventObject

 

o

ruleName

Name of the rule. Kernel defined rule name may be used

 

o

pyEventName

Name of the event

 

o

return

Added event object

 

[Example]

   eventObject = wmRuleInitOperator.AddPyEvent('RetractRule', 'LaserEvent')

   eventObject.SetBool("IsLocked", True)

 


 

RemoveEventFromRule(ruleName: string, eventName: string)

 

o

ruleName

Name of the rule. Kernel defined rule name may be used

 

o

eventame

Name of the event.  Kernel defined event name may be used

 

[Example]

   wmRuleInitOperator.RemoveEventFromRule('Approach', 'TwoPointApproach')

 


 

SetActivePyEvent(ruleName: string,  eventName: string)

 

o

ruleName

Name of the rule. Kernel and python defined rule name may be used

 

o

eventame

Name of the event.  Kernel and python defined event name may be used

 

[Example]

   wmRuleInitOperator.SetActivePyEvent('Retract', 'ChangeRecipeEvent')

 


 

GetController(): CENPyOlpController

 

o

return

Object of CENPyOlpController class

 

[Example]

   olpController = wmRuleInitOperator.GetController()

 


 

GetLoggerOperator(): CENPyOlpLogOperator

 

o

return

Object of CENPyOlpLogOperator class

 

[Example]

   logOperator = wmRuleInitOperator.GetLoggerOperator()

 


 

OverrideEventRuleInsertPosition(ruleName: string, insertPos: TPInsertPosition)

 

o

ruleName

Name of the rule. Kernel defined rule name should be used

 

o

insertPos

New insert position

 

Set the new insert position for the event rules with given name.

 

[Example]

   wmRuleInitOperator.OverrideEventRuleInsertPosition("GlueOnRule", TPINSERTPOS_INSERTAFTER)

 

 


 

 


Previous
Page précédente
Chapter
Page principale du chapitre
Next
Page suivante