The object of the CENPyOlpAttribCreator class may be used to initialize new attributes.
[Example 1]
def PostTechInitAttributes(techAttribInitOperator):
attribCreator = techAttribInitOperator.GetAttribCreator()
[Example 2]
def PostWmInitAttributes(wmAttribInitOperator):
attribCreator = wmAttribInitOperator.GetAttribCreator()
att = attribCreator.AddString("Attrib0", '0', OPERATION_ATTRIBUTE | USER_ATTRIBUTE, "Attrib0")
att.SetReComputeEnterState(ENTERSTATE_COMPLETE)
•
|
AddInteger(attributeName: string, defaultValue: int, minValue: int, maxValue: int, attributeUseLevel: int, nlsName: string) : CENPyOlpAttributeInt
|
|
|
The name of the attribute
|
|
|
Default value
|
|
|
The minimum value of the attribute
|
|
|
The maximum value of the attribute
|
|
|
Is a bitmask and can be a combination of one ore more levels. (see Attribute use level )
|
|
|
The NLS(National Language Support) string
|
|
|
Object of CENPyOlpAttributeInt class
|
[Example]
attributeInteger = attribCreator.AddInteger('MyIntAttribute', 0, -100, 0, USER_ATTRIBUTE | PROCESS_ATTRIBUTE | GLOBAL_ATTRIBUTE, 'MyIntAttribute')
•
|
AddDouble(attributeName: string, defaultValue: float, minValue: float, maxValue: float, step: float, attributeUseLevel: int, attributeType: int, nlsName: string) : CENPyOlpAttributeDouble
|
|
|
The name of the attribute
|
|
|
Default value
|
|
|
The minimum value of the attribute
|
|
|
The maximum value of the attribute
|
|
|
The step size in panel when click up/down arrow
|
|
|
Is a bitmask and can be a combination of one ore more levels. (see Attribute use level )
|
|
|
The attribute type. (see Attribute Types )
|
|
|
The NLS(National Language Support) string
|
|
|
Object of CENPyOlpAttributeDouble class
|
[Example]
attributeDouble = attribCreator.AddDouble('MyDoubleAttribute', 55.5, 0, 100, 0.5, USER_ATTRIBUTE | PROCESS_ATTRIBUTE | GLOBAL_ATTRIBUTE, ATTRIB_STANDARD, 'MyDoubleAttribute')
•
|
AddString(attributeName: string, defaultValue: string, attributeUseLevel: int, nlsName: string) : CENPyOlpAttributeString
|
|
|
The name of the attribute
|
|
|
Default value
|
|
|
Is a bitmask and can be a combination of one ore more levels. (see Attribute use level )
|
|
|
The NLS(National Language Support) string
|
|
|
Object of CENPyOlpAttributeString class
|
[Example]
attributeString = attribCreator.AddString('MyStringAttribute', 'Hello World', USER_ATTRIBUTE | PROCESS_ATTRIBUTE | GLOBAL_ATTRIBUTE, 'MyStringAttribute')
•
|
AddBool(attributeName: string, defaultValue: int, attributeUseLevel: int, nlsName: string) : CENPyOlpAttributeBool
|
|
|
The name of the attribute
|
|
|
Default value can bee 0 or 1 where 0=False and 1=True
|
|
|
Is a bitmask and can be a combination of one ore more levels. (see Attribute use level )
|
|
|
The NLS(National Language Support) string
|
|
|
Object of CENPyOlpAttributeBool class
|
[Example]
attributeBool = attribCreator.AddBool('MyBoolAttribute', True, USER_ATTRIBUTE | PROCESS_ATTRIBUTE | GLOBAL_ATTRIBUTE, 'MyBoolAttribute')
•
|
AddEnum(attributeName: string, literals: list, defaultValue: string, attributeUseLevel: int, nlsName: string) : CENPyOlpAttributeEnum
|
[Example]
myLiterals = ["earth", "revolves", "around"] # list of three literals
myLiterals.insert(0,"The") # insert a new literal at first list position
myLiterals.append("sun") # append a new literal at last list position
attributeEnum = attribCreator.AddEnum('MyEnumAttribute', myLiterals, 'earth', USER_ATTRIBUTE | PROCESS_ATTRIBUTE | GLOBAL_ATTRIBUTE, 'MyEnumAttribute')
[Example]
from CENPyOlpSystemAttribCreator import * # import is required to use object of CENPyOlpSystemAttribCreator class
def PostTechInitAttributes(techAttribInitOperator):
attribCreator = techAttribInitOperator.GetAttribCreator()
sysAttribCreator = attribCreator.GetSystemAttribCreator()
|