mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Drop use of removed entity_instance.wrapped_data
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user