Python scripting - Technology callbacks

PostTechInitRules

 

The callback PostTechInitRules(CENPyOlpTech_RuleInitOperator) is called just after the kernel initializes the technology event rules.

 

It can be used to:

- initialize technology event rules

- output to the log

 

In order to add an event to the rule it should be registered in PostTechInitEvents callback.

 

The callback is defined in the %TechnologyName%.py file.

 

PostTechInitRules

 

 

[Example]

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

def PostTechInitRules(trio):

   trio.AddPyEvent('myRetractRule', 'GasEvent')

   trio.AddPyEvent('myRetractRule', 'LaserEvent')

 

[Example]

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

 

from centypes import *

 

def GetRuleProcessType():

   return EVENTPROCESS_RETRACT

   

def GetInsertPosition():

   return TPINSERTPOS_INSERTAFTER

   

def GetActiveEvent():

   return 0

   

def GetVisibility():

   return True

 


PostTechInitRules_Ex

 


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