Python scripting - Event operators

CENPyOlpEvent_AttribChangedOperator

Previous  Chapter  Next

 

The object of the CENPyOlpEvent_AttribChangedOperator class is passed to the PostOnAttribChanged callback as a parameter.

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

 

[Example]

 

def PostOnAttribChanged(seriesAttribChangedOperator):

   pass

 

 

Methods

 

GetAttribGetter()

 

o

return

Object of CENPyOlpAttribGetter class

 

This operator gives the possibility to find attribute and get their values.

 

[Example]

   attribGetter = seriesAttribChangedOperator.GetAttribGetter()

 


 

GetAttribSetter()

 

o

return

Object of CENPyOlpAttribSetter class

 

This operator gives the possibility to change attribute values.

 

[Example]

   attribSetter = seriesAttribChangedOperator.GetAttribSetter()

 


 

GetLoggerOperator()

 

o

return

Object of CENPyOlpLogOperator class

 

This operator gives the possibility to log issues resulting by user input.

 

[Example]

   logOperator = seriesAttribChangedOperator.GetLoggerOperator()

 


 

 Method is deprecated, consider using GetChangedAttributeName()

 

GetChangedAttribute()

 

o

return

Object of CENPyOlpAttribute class

 

 This method returns the changed attribute which rises the OnAttribChanged callback.

 

[Example]

   changedAttrib = seriesAttribChangedOperator.GetChangedAttribute()

 


 

GetChangedAttributeName()

 

o

return

name of the changed attribute

 

 This method returns the name of changed attribute which rises OnAttribChanged callback.

 

[Example]

def PostOnAttribChanged(Operator):

   logging = Operator.GetLoggerOperator()

   logging.LogInfo(FILE_NAME +" GetChangedAttributeName:"+ Operator.GetChangedAttributeName())

 


 

IsEventCreatedAutomatically(): bool

 

o

return

True if the Event was created by a rule or by another Event, False if inserted manually.

 

Get if the reference event was created by a rule, another event, or inserted manually.

 

[Example]

logging.LogInfo(f"Current event was created automatically = {seriesAttribChangedOperator.IsEventCreatedAutomatically()}.")

 


 

 


Previous
Previous page
Chapter
Chapter page
Next
Next page