Python scripting - Event callbacks

PostInitAttributes

 

The callback PostInitAttributes(CENPyOlpEvent_AttribInitOperator) is called when the kernel initializes the event attributes.

 

It can be used to:

- initialize attributes

- get attribute values

- set attribute values

- access OlpController

- output to the log

 

The callback is defined in %EVENT_NAME%.py file.

 

PostInitAttributes

 

[Example]

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

 

 

def PostInitAttributes(EventAttribInitOperator):

 

   attribCreator = EventAttribInitOperator.GetAttribCreator()

   

   # Laser type

   attribCreator.AddEnum(LASER_TYPE, LASER_TYPE_LIST, LASER_TYPE_LIST[0], USER_ATTRIBUTE | PROCESS_ATTRIBUTE, LASER_TYPE)

   

   # Laser offset

   attribCreator.AddDouble(LASER_OFFSET, 0.0,0.0,1000.0,1.0, USER_ATTRIBUTE | PROCESS_ATTRIBUTE, ATTRIB_LENGTH, LASER_OFFSET)

 


PostInitAttributes_Ex

 


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