mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 23:11:00 +00:00
Drop use of removed entity_instance.wrapped_data
This commit is contained in:
@@ -652,7 +652,7 @@ class DecoratorData:
|
|||||||
try:
|
try:
|
||||||
matrix = ifcopenshell.util.placement.get_local_placement(element.ObjectPlacement)
|
matrix = ifcopenshell.util.placement.get_local_placement(element.ObjectPlacement)
|
||||||
if matrix is not None:
|
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
|
project = ifc_file.by_type("IfcProject")[0] if ifc_file.by_type("IfcProject") else None
|
||||||
|
|
||||||
if project:
|
if project:
|
||||||
|
|||||||
@@ -887,8 +887,8 @@ def usedin(inst, ref_name):
|
|||||||
return []
|
return []
|
||||||
_, __, attr = ref_name.split('.')
|
_, __, attr = ref_name.split('.')
|
||||||
def filter():
|
def filter():
|
||||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
if ref.get_attribute_names()[attr_idx].lower() == attr:
|
||||||
yield ref
|
yield ref
|
||||||
return list(filter())
|
return list(filter())
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ def usedin(inst, ref_name):
|
|||||||
_, __, attr = ref_name.split('.')
|
_, __, attr = ref_name.split('.')
|
||||||
|
|
||||||
def filter():
|
def filter():
|
||||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
if ref.get_attribute_names()[attr_idx].lower() == attr:
|
||||||
yield ref
|
yield ref
|
||||||
return list(filter())
|
return list(filter())
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ def usedin(inst, ref_name):
|
|||||||
_, __, attr = ref_name.split('.')
|
_, __, attr = ref_name.split('.')
|
||||||
|
|
||||||
def filter():
|
def filter():
|
||||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
if ref.get_attribute_names()[attr_idx].lower() == attr:
|
||||||
yield ref
|
yield ref
|
||||||
return list(filter())
|
return list(filter())
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ def usedin(inst, ref_name):
|
|||||||
_, __, attr = ref_name.split('.')
|
_, __, attr = ref_name.split('.')
|
||||||
|
|
||||||
def filter():
|
def filter():
|
||||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
if ref.get_attribute_names()[attr_idx].lower() == attr:
|
||||||
yield ref
|
yield ref
|
||||||
return list(filter())
|
return list(filter())
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ def usedin(inst, ref_name):
|
|||||||
_, __, attr = ref_name.split('.')
|
_, __, attr = ref_name.split('.')
|
||||||
|
|
||||||
def filter():
|
def filter():
|
||||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
if ref.get_attribute_names()[attr_idx].lower() == attr:
|
||||||
yield ref
|
yield ref
|
||||||
return list(filter())
|
return list(filter())
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ def usedin(inst, ref_name):
|
|||||||
_, __, attr = ref_name.split('.')
|
_, __, attr = ref_name.split('.')
|
||||||
|
|
||||||
def filter():
|
def filter():
|
||||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
if ref.get_attribute_names()[attr_idx].lower() == attr:
|
||||||
yield ref
|
yield ref
|
||||||
return list(filter())
|
return list(filter())
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ def usedin(inst, ref_name):
|
|||||||
_, __, attr = ref_name.split('.')
|
_, __, attr = ref_name.split('.')
|
||||||
|
|
||||||
def filter():
|
def filter():
|
||||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
if ref.get_attribute_names()[attr_idx].lower() == attr:
|
||||||
yield ref
|
yield ref
|
||||||
return list(filter())
|
return list(filter())
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ def usedin(inst, ref_name):
|
|||||||
_, __, attr = ref_name.split('.')
|
_, __, attr = ref_name.split('.')
|
||||||
|
|
||||||
def filter():
|
def filter():
|
||||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
if ref.get_attribute_names()[attr_idx].lower() == attr:
|
||||||
yield ref
|
yield ref
|
||||||
return list(filter())
|
return list(filter())
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ def usedin(inst, ref_name):
|
|||||||
_, __, attr = ref_name.split('.')
|
_, __, attr = ref_name.split('.')
|
||||||
|
|
||||||
def filter():
|
def filter():
|
||||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
if ref.get_attribute_names()[attr_idx].lower() == attr:
|
||||||
yield ref
|
yield ref
|
||||||
return list(filter())
|
return list(filter())
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ def usedin(inst, ref_name):
|
|||||||
_, __, attr = ref_name.split('.')
|
_, __, attr = ref_name.split('.')
|
||||||
|
|
||||||
def filter():
|
def filter():
|
||||||
for ref, attr_idx in inst.wrapped_data.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
for ref, attr_idx in inst.file.get_inverse(inst, allow_duplicate=True, with_attribute_indices=True):
|
||||||
if ref.wrapped_data.get_attribute_names()[attr_idx].lower() == attr:
|
if ref.get_attribute_names()[attr_idx].lower() == attr:
|
||||||
yield ref
|
yield ref
|
||||||
return list(filter())
|
return list(filter())
|
||||||
|
|
||||||
|
|||||||
@@ -487,13 +487,13 @@ class Migrator:
|
|||||||
# IFC2X3 stand-in; non-element IFC4-only classes (rels, geometry items,
|
# IFC2X3 stand-in; non-element IFC4-only classes (rels, geometry items,
|
||||||
# materials, times) still raise below.
|
# materials, times) still raise below.
|
||||||
if not equivalent and new_file.schema == "IFC2X3" and self.fallback_element_to_proxy:
|
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"
|
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"
|
equivalent = "IfcBuildingElementProxyType"
|
||||||
|
|
||||||
if not equivalent:
|
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])
|
inverse_hint = ", ".join(f"#{i.id()}={i.is_a()}" for i in list(inverses)[:3])
|
||||||
if len(inverses) > 3:
|
if len(inverses) > 3:
|
||||||
inverse_hint += f", … (+{len(inverses) - 3} more)"
|
inverse_hint += f", … (+{len(inverses) - 3} more)"
|
||||||
|
|||||||
Reference in New Issue
Block a user