From 261de9b2be8ca5d8493656e378ac70f26a1a9b74 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 25 Apr 2025 16:14:31 +0500 Subject: [PATCH] entity_instance.__getattr__ - document some attributes conversion to Python --- src/ifcopenshell-python/ifcopenshell/entity_instance.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/entity_instance.py b/src/ifcopenshell-python/ifcopenshell/entity_instance.py index d01c618d52..60bc0ad138 100644 --- a/src/ifcopenshell-python/ifcopenshell/entity_instance.py +++ b/src/ifcopenshell-python/ifcopenshell/entity_instance.py @@ -181,6 +181,12 @@ class entity_instance: return file.from_pointer(self.wrapped_data.file_pointer()) def __getattr__(self, name: str) -> Any: + """ + Any aggregate attributes (e.g. `SET`) are returns as Python tuples. + + Inverse attributes are always returned as tuples, even it's not a set origially in IFC + (e.g. IfcFeatureElementSubtraction.VoidsElements) + """ INVALID, FORWARD, INVERSE = range(3) attr_cat = self.wrapped_data.get_attribute_category(name) if attr_cat == FORWARD: