Python scripting - Common operators

CENPyOlpAttribGetter

 

The object of the CENPyOlpAttribGetter class may be used to obtain values of attributes.

 

 

[Example 1]

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

 

def PostTechInitAttributes(techAttribInitOperator):  

attribGetter = techAttribInitOperator.GetAttribGetter()

 

def PostInitManufacturingGeometry(techMfGeoInitOperator):

attribGetter = techMfGeoInitOperator.GetAttribGetter()

 

[Example 2]

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

 

def PostWmInitAttributes(wmAttribInitOperator):  

attribGetter = wmAttribInitOperator.GetAttribGetter()

 

 

Methods

 

GetInteger(attributeName: string): int

 

o

attributeName

The name of the attribute

 

o

return

The value of the attribute

 

[Example]

   valOfMyIntAttrib = attribGetter.GetInteger('MyIntAttribute')

 


 

GetDouble(attributeName: string): float

 

o

attributeName

The name of the attribute

 

o

return

The value of the attribute

 

[Example]

   valOfMyDoubleAttrib = attribGetter.GetDouble('MyDoubleAttribute')


 

GetString(attributeName: string): string

 

o

attributeName

The name of the attribute

 

o

return

The value of the attribute

 

[Example]

   valOfMyStrAttrib = attribGetter.GetString('MyStringAttribute')

 


 

GetBool(attributeName: string): bool

 

o

attributeName

The name of the attribute

 

o

return

The value of the attribute

 

[Example]

   valOfMyBoolAttrib = attribGetter.GetBool('MyBoolAttribute')

 


 

GetEnumIndex(attributeName: string): integer

 

o

attributeName

The name of the attribute

 

o

return

The index of the attribute

 

[Example]

   indexOfMyEnumAttrib = attribGetter.GetEnumIndex('MyEnumAttribute')

 


 

GetAttributeByName(name: string): CENPyOlpAttribute

 

 

o

name

name of attribute to search for

 

o

return

CENPyOlpAttribute object

 

[Example]

   foundAttribute = attribGetter.GetAttributeByName('MyIntAttribute')

 


 

GetAttributeBoolByName(name: string): CENPyOlpAttributeBool

 

 

o

name

name of attribute to search for

 

o

return

CENPyOlpAttributeBool object

 

[Example]

   foundAttribute = attribGetter.GetAttributeBoolByName('MyBoolAttribute')

 


 

GetAttributeEnumByName(name: string): CENPyOlpAttributeEnum

 

 

o

name

name of attribute to search for

 

o

return

CENPyOlpAttributeEnum object

 

[Example]

   foundAttribute = attribGetter.GetAttributeEnumByName('MyEnumAttribute')

 


 

GetAttributeDoubleByName(name: string): CENPyOlpAttributeDouble

 

 

o

name

name of attribute to search for

 

o

return

CENPyOlpAttributeDouble object

 

[Example]

   foundAttribute = attribGetter.GetAttributeDoubleByName('MyDoubleAttribute')

 


 

GetSystemAttribGetter(): CENPyOlpSystemAttribGetter

 

 

o

return

CENPyOlpSystemAttribGetter object

 

[Example]

   sysAttribGetter = attribGetter.GetSystemAttribGetter()

 


 

 


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