Python scripting - Technology callbacks

PostProcessOperationGroupAttributes

 

The callback PostProcessOperationGroupAttributes(CENPyOlpTech_POGAttribOperator) is called just before an operation group is computed.

 

It can be used to:

- get operation group attribute values

- set operation group attribute values

- access csv files

- output to the log

 

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

 

PostProcessOperationGroupAttributes

 

[Example]

 

def PostProcessOperationGroupAttributes(poga):

# Get values from attributes

   attribGetter = poga.GetAttribGetter()

   valOfMyIntAttrib = attribGetter.GetInteger('MyIntAttribute')

   valOfMyDoubleAttrib = attribGetter.GetDouble('MyDoubleAttribute')   

   valOfMyStrAttrib = attribGetter.GetString('MyStringAttribute')

   valOfMyBoolAttrib = attribGetter.GetBool('MyBoolAttribute')

   indexOfMyEnumAttrib = attribGetter.GetEnumIndex('MyEnumAttribute')

 

# Set values to the attributes

   attribSetter = poga.GetAttribSetter()

   attribSetter.SetInteger('MyIntAttribute', 15)

   attribSetter.SetDouble('MyDoubleAttribute', 15.8)

   attribSetter.SetString('MyStringAttribute', 'This is new string')

   attribSetter.SetBool('MyBoolAttribute', False)

   attribSetter.SetEnumIndex('MyEnumAttribute', 4)   

   

# Output attribute value to the log

   logOperator = techAttribInitOperator.GetLoggerOperator()

   logOperator.LogDebug('indexOfMyEnumAttrib = ' + str(indexOfMyEnumAttrib))

 


PostProcessOperationGroupAttributes_Ex

 


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