mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Remove usage of .wrapped_item and some other fixes
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user