Remove usage of .wrapped_item and some other fixes

This commit is contained in:
Thomas Krijnen
2026-01-10 11:01:18 +01:00
parent 5c9213426f
commit b66b04b001
55 changed files with 129 additions and 118 deletions
@@ -70,7 +70,7 @@ def get_declaration(element: ifcopenshell.entity_instance):
print(declaration.is_abstract()) # False
print(declaration.supertype().name()) # IfcBuildingElement
"""
return element.wrapped_data.declaration().as_entity()
return element.declaration().as_entity()
def is_a(declaration: ifcopenshell.ifcopenshell_wrapper.declaration, ifc_class: str) -> bool:
@@ -104,7 +104,7 @@ def get_supertypes(
.. code:: python
wall = model.createIfcWall()
results = ifcopenshell.util.schema.get_supertypes(wall.wrapped_data.declaration().as_entity())
results = ifcopenshell.util.schema.get_supertypes(wall.declaration().as_entity())
# [<entity IfcBuildingElement>, <entity IfcElement>, ..., <entity IfcRoot>]
"""
results = []
@@ -462,7 +462,7 @@ class Migrator:
) -> None:
# NOTE: `attribute` is an attribute in new file schema
# print("Migrating attribute", element, new_element, attribute.name())
old_file = element.wrapped_data.file
old_file = element.file
if hasattr(element, attribute.name()):
value = getattr(element, attribute.name())
# print("Attribute names matched", value)