From c4e411c73594a18415e2b9e75fc30a369bda0994 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 22 Jul 2026 14:43:38 +0500 Subject: [PATCH] Drop use of removed `entity_instance.wrapped_data` --- src/bonsai/bonsai/bim/module/drawing/data.py | 2 +- .../ifcopenshell/express/rule_compiler.py | 4 ++-- .../ifcopenshell/express/rules/IFC2X3.py | 4 ++-- src/ifcopenshell-python/ifcopenshell/express/rules/IFC4.py | 4 ++-- .../ifcopenshell/express/rules/IFC4X1.py | 4 ++-- .../ifcopenshell/express/rules/IFC4X2.py | 4 ++-- .../ifcopenshell/express/rules/IFC4X3_ADD2.py | 4 ++-- .../ifcopenshell/express/rules/IFC4X3_RC1.py | 4 ++-- .../ifcopenshell/express/rules/IFC4X3_RC2.py | 4 ++-- .../ifcopenshell/express/rules/IFC4X3_RC3.py | 4 ++-- .../ifcopenshell/express/rules/IFC4X3_RC4.py | 4 ++-- src/ifcopenshell-python/ifcopenshell/util/schema.py | 6 +++--- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/drawing/data.py b/src/bonsai/bonsai/bim/module/drawing/data.py index 23ee7c1987..de19f1ea21 100644 --- a/src/bonsai/bonsai/bim/module/drawing/data.py +++ b/src/bonsai/bonsai/bim/module/drawing/data.py @@ -652,7 +652,7 @@ class DecoratorData: try: matrix = ifcopenshell.util.placement.get_local_placement(element.ObjectPlacement) if matrix is not None: - ifc_file = element.wrapped_data.file + ifc_file = element.file project = ifc_file.by_type("IfcProject")[0] if ifc_file.by_type("IfcProject") else None if project: diff --git a/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py b/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py index 05ca8f8d45..0fdc01f86c 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py @@ -887,8 +887,8 @@ def usedin(inst, ref_name): return [] _, __, attr = ref_name.split('.') def filter(): - for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): - if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: + for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + if ref.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC2X3.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC2X3.py index da801d204f..2192e84cb3 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC2X3.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC2X3.py @@ -47,8 +47,8 @@ def usedin(inst, ref_name): _, __, attr = ref_name.split('.') def filter(): - for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): - if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: + for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + if ref.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4.py index 169b72f531..22723bc4dd 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4.py @@ -47,8 +47,8 @@ def usedin(inst, ref_name): _, __, attr = ref_name.split('.') def filter(): - for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): - if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: + for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + if ref.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X1.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X1.py index a73d67d7e0..5db63ce0b4 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X1.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X1.py @@ -47,8 +47,8 @@ def usedin(inst, ref_name): _, __, attr = ref_name.split('.') def filter(): - for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): - if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: + for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + if ref.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X2.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X2.py index 7b8c8513f0..b0b44fb38c 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X2.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X2.py @@ -47,8 +47,8 @@ def usedin(inst, ref_name): _, __, attr = ref_name.split('.') def filter(): - for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): - if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: + for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + if ref.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_ADD2.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_ADD2.py index 9b2f43bc34..fe8880f295 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_ADD2.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_ADD2.py @@ -47,8 +47,8 @@ def usedin(inst, ref_name): _, __, attr = ref_name.split('.') def filter(): - for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): - if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: + for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + if ref.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC1.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC1.py index 0c029cf61b..daedc2db31 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC1.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC1.py @@ -47,8 +47,8 @@ def usedin(inst, ref_name): _, __, attr = ref_name.split('.') def filter(): - for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): - if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: + for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + if ref.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC2.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC2.py index c24f900294..5aa5b7f1e2 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC2.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC2.py @@ -47,8 +47,8 @@ def usedin(inst, ref_name): _, __, attr = ref_name.split('.') def filter(): - for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): - if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: + for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + if ref.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC3.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC3.py index 8ff30987bd..1ba78e1f4c 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC3.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC3.py @@ -47,8 +47,8 @@ def usedin(inst, ref_name): _, __, attr = ref_name.split('.') def filter(): - for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): - if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: + for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + if ref.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) diff --git a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC4.py b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC4.py index 2606cbcbc7..2fe80bbc98 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC4.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rules/IFC4X3_RC4.py @@ -47,8 +47,8 @@ def usedin(inst, ref_name): _, __, attr = ref_name.split('.') def filter(): - for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): - if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr: + for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True): + if ref.get_attribute_names()[attr_idx].lower() == attr: yield ref return list(filter()) diff --git a/src/ifcopenshell-python/ifcopenshell/util/schema.py b/src/ifcopenshell-python/ifcopenshell/util/schema.py index db2e629e10..e2e0599b76 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/schema.py +++ b/src/ifcopenshell-python/ifcopenshell/util/schema.py @@ -487,13 +487,13 @@ class Migrator: # IFC2X3 stand-in; non-element IFC4-only classes (rels, geometry items, # materials, times) still raise below. if not equivalent and new_file.schema == "IFC2X3" and self.fallback_element_to_proxy: - if self._is_subclass_of(ifc_class, "IfcElement", element.wrapped_data.file): + if self._is_subclass_of(ifc_class, "IfcElement", element.file): equivalent = "IfcBuildingElementProxy" - elif self._is_subclass_of(ifc_class, "IfcElementType", element.wrapped_data.file): + elif self._is_subclass_of(ifc_class, "IfcElementType", element.file): equivalent = "IfcBuildingElementProxyType" if not equivalent: - inverses = element.wrapped_data.file.get_inverse(element) + inverses = element.file.get_inverse(element) inverse_hint = ", ".join(f"#{i.id()}={i.is_a()}" for i in list(inverses)[:3]) if len(inverses) > 3: inverse_hint += f", … (+{len(inverses) - 3} more)"