ElementsByAttributeService
Canonical path: NemAll_Python_BaseElements.ElementsByAttributeService
Service for selecting elements in the current document based on the value of a specific attribute. The ID of this attribute must be given during the service initialization. The service is a singleton, meaning that there can only exist one instance of it.
Examples:
Initialize the service as follows:
Then select elements whose attribute value is equal to the desired one, as follows:
>>> elements = AllplanBaseElements.ElementsByAttributeService.GetInstance().GetElements(attribute_value)
GetElements
overloaded
GetElements(attributeValue: float) -> BaseElementAdapterList
Get the elements for the double attribute value
Parameters:
-
attributeValue
(float
) –Attribute value
Returns:
-
BaseElementAdapterList
–Elements
GetElements(attributeValue: int) -> BaseElementAdapterList
Get the elements for the integer attribute value
Parameters:
-
attributeValue
(int
) –Attribute value
Returns:
-
BaseElementAdapterList
–Elements
GetElements(attributeValue: str) -> BaseElementAdapterList
Get the elements for the string attribute value
Parameters:
-
attributeValue
(str
) –Attribute value
Returns:
-
BaseElementAdapterList
–Elements
GetInstance
staticmethod
GetInstance() -> ElementsByAttributeService
Init
Init(attributeID: int, doc: DocumentAdapter)
Initialize the service.
Parameters:
-
attributeID
(int
) –Attribute ID. Used for creating fast element access by an attribute value of this ID
-
doc
(DocumentAdapter
) –Document