Skip to content

Attribute Service

Class full path: NemAll_Python_BaseElements.AttributeService

Classes

AttributeControlType

Bases: IntEnum

Attribute control types

Functions

__getitem__(key)

get the item for a key

Parameters:

Name Type Description Default
key str | int | float

value key

required

Returns:

Type Description
AttributeControlType

value for the key

AttributeSelectionDialogType

Bases: IntEnum

Type of the attribute selection dialog

Functions

__getitem__(key)

get the item for a key

Parameters:

Name Type Description Default
key str | int | float

value key

required

Returns:

Type Description
AttributeSelectionDialogType

value for the key

AttributeType

Bases: IntEnum

Attribute types

Functions

__getitem__(key)

get the item for a key

Parameters:

Name Type Description Default
key str | int | float

value key

required

Returns:

Type Description
AttributeType

value for the key

Functions

AddUserAttribute(doc, attributeType, attributeName, attributeDefaultValue, attributeMinValue, attributeMaxValue, attributeDimension, attributeCtrlType, attributeListValues) staticmethod

Add a user attribute

Parameters:

Name Type Description Default
doc DocumentAdapter

Document

required
attributeType AttributeType

Type

required
attributeName str

Name

required
attributeDefaultValue str

Default value

required
attributeMinValue float

Minimal value

required
attributeMaxValue float

Maximal value

required
attributeDimension str

Dimension

required
attributeCtrlType AttributeControlType

Control type

required
attributeListValues VecStringList

List with the allowed attribute values

required

Returns:

Type Description
int

ID of the added user attribute, -1 = not possible to add

GetAttributeControlType(doc, attributeID) staticmethod

Get the control type of the attribute

Parameters:

Name Type Description Default
doc DocumentAdapter

Document

required
attributeID int

Attribute ID

required

GetAttributeID(doc, attributeName) staticmethod

Get the attribute ID

Parameters:

Name Type Description Default
doc DocumentAdapter

Document

required
attributeName str

Attribute name

required

Returns:

Type Description
int

Attribute ID

GetAttributeName(doc, attributeID) staticmethod

Get the attribute name

Parameters:

Name Type Description Default
doc DocumentAdapter

Document

required
attributeID int

Attribute ID

required

Returns:

Type Description
str

Attribute name

GetAttributeType(doc, attributeID) staticmethod

Get the attribute type

Parameters:

Name Type Description Default
doc DocumentAdapter

Document

required
attributeID int

Attribute ID

required

GetDefaultValue(doc, attributeID) staticmethod

Get the default value of an attribute

Parameters:

Name Type Description Default
doc DocumentAdapter

Document

required
attributeID int

Attribute ID

required

Returns:

Type Description
Union[int, float, str]

Default value of the attribute

GetEnumIDFromValueString(attributeID, valueString) staticmethod

Get the enumeration ID from the value string

Parameters:

Name Type Description Default
attributeID int

Attribute ID

required
valueString str

Value string

required

Returns:

Type Description
int

Enumeration ID

GetEnumValueStringFromID(attributeID, enumID) staticmethod

Get the enumeration value string from the enumeration ID

Parameters:

Name Type Description Default
attributeID int

Attribute ID

required
enumID int

Enumeration ID

required

Returns:

Type Description
str

Enumeration value string

GetEnumValues(doc, attributeID) staticmethod

Get the enum attribute values

Parameters:

Name Type Description Default
doc DocumentAdapter

Document

required
attributeID int

Attribute ID

required

Returns:

Type Description
list[str]

Default attribute value

GetInputListValues(doc, attributeID) staticmethod

Get the input list values

Parameters:

Name Type Description Default
doc DocumentAdapter

Document

required
attributeID int

Attribute ID

required

Returns:

Type Description
list[str]

Attribute input list values

OpenAttributeSelectionDialog(doc, dialogType) staticmethod

Open the attribute selection dialog

Parameters:

Name Type Description Default
doc DocumentAdapter

Document

required
dialogType AttributeSelectionDialogType

Dialog type

required

Returns:

Type Description
int

Attribute ID