Skip to Content
Python APIRückrufeIOlpTechnologiePostTechBeiAttributÄnderung

PostTechOnAttribChanged

The callback PostTechOnAttribChanged (CENPyOlpTech_AttribChangedOperator) is called from the kernel when a technology attribute has been changed.

Es kann verwendet werden, um:

  • Attributwerte abrufen

  • Attributwerte festlegen

  • Ausgabe in das Protokoll

  • Zugriff auf OlpController

The callback is defined in the %TechnologyName%.py file that is located in the scripts folder of the plugin.

def PostTechInitAttributes(Operator): attribCreator = Operator.GetAttribCreator() attribCreator.AddDouble(testDouble, 0.0, 0.0, 256.0, 0.1, USER_ATTRIBUTE | PROCESS_ATTRIBUTE | GLOBAL_ATTRIBUTE, ATTRIB_STANDARD, testDouble) attribCreator.AddInteger(testInt, 0, 0, 256, USER_ATTRIBUTE | PROCESS_ATTRIBUTE | GLOBAL_ATTRIBUTE, testInt) def PostTechOnAttribChanged(Operator): changedAttribute = Operator.GetChangedAttribute() changedAttributeName = changedAttribute.GetName() if changedAttributeName == testDouble: attribGetter = Operator.GetAttribGetter() attribSetter = Operator.GetAttribSetter() testDoubleValue = attribGetter.GetDouble(testDouble) testDoubleValueRound = round(testDoubleValue) attribSetter.SetInteger(testInt, testDoubleValueRound)
Was this page helpful?