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.

 

[Example]

File: Samples\JenoptikPluginUpdated\Plugin\TechnologyPackages\LaserCuttingTechnology\Jenoptik\REGSHAPE_METHOD.py

 

def PostWmInitRules(wmRuleInitOperator):

 

Methods

 

AddPyEvent(ruleName: string, pyEventName: string)

 

o

ruleName

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

 

o

pyEventame

Name of the event

 

[Example]

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

 


 

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