diff --git a/src/bonsai/bonsai/bim/helper.py b/src/bonsai/bonsai/bim/helper.py index 4acc31b160..c1277bedf8 100644 --- a/src/bonsai/bonsai/bim/helper.py +++ b/src/bonsai/bonsai/bim/helper.py @@ -187,7 +187,7 @@ def import_attributes( info = {a.name(): None for a in attributes} info["type"] = element else: - assert (entity := element.declaration().as_entity()) + assert (entity := element.declaration.as_entity()) attributes = entity.all_attributes() info = element.get_info() for attribute in attributes: diff --git a/src/bonsai/bonsai/bim/module/cost/data.py b/src/bonsai/bonsai/bim/module/cost/data.py index 3c96c8828a..14967d032d 100644 --- a/src/bonsai/bonsai/bim/module/cost/data.py +++ b/src/bonsai/bonsai/bim/module/cost/data.py @@ -206,7 +206,7 @@ class CostSchedulesData: data["UnitSymbol"] = ifcopenshell.util.unit.get_unit_symbol(unit) if quantity.is_a("IfcPhysicalSimpleQuantity"): measure_class = ( - quantity.declaration() + quantity.declaration .as_entity() .attribute_by_index(3) .type_of_attribute() diff --git a/src/bonsai/bonsai/bim/module/search/data.py b/src/bonsai/bonsai/bim/module/search/data.py index e4fc6f854a..0a0fd51219 100644 --- a/src/bonsai/bonsai/bim/module/search/data.py +++ b/src/bonsai/bonsai/bim/module/search/data.py @@ -95,7 +95,7 @@ class ColourByPropertyData: element = tool.Ifc.get_entity(obj) if not element: return default - keys = [a.name() for a in element.declaration().as_entity().all_attributes()] + keys = [a.name() for a in element.declaration.as_entity().all_attributes()] psets = ifcopenshell.util.element.get_psets(element) for pset, properties in psets.items(): if pset.endswith("Common"): @@ -126,7 +126,7 @@ class SelectSimilarData: element = tool.Ifc.get_entity(obj) if not element: return [] - keys = [a.name() for a in element.declaration().as_entity().all_attributes()] + keys = [a.name() for a in element.declaration.as_entity().all_attributes()] psets = ifcopenshell.util.element.get_psets(element, psets_only=True) for pset, properties in psets.items(): if pset.endswith("Common"): diff --git a/src/bonsai/bonsai/tool/geometry.py b/src/bonsai/bonsai/tool/geometry.py index 5e07de2969..c647682679 100644 --- a/src/bonsai/bonsai/tool/geometry.py +++ b/src/bonsai/bonsai/tool/geometry.py @@ -2166,7 +2166,7 @@ class Geometry(bonsai.core.tool.Geometry): item = tool.Ifc.get().by_id(props.ifc_definition_id) allowed_attributes = [ a.name() - for a in item.declaration().as_entity().all_attributes() + for a in item.declaration().as_entity.all_attributes() if a.type_of_attribute()._is("IfcLengthMeasure") ] diff --git a/src/ifc5d/ifc5d/ifc2json.py b/src/ifc5d/ifc5d/ifc2json.py index 344d36f095..a3938f8d60 100644 --- a/src/ifc5d/ifc5d/ifc2json.py +++ b/src/ifc5d/ifc5d/ifc2json.py @@ -168,7 +168,7 @@ class ifc5D2json: data["UnitSymbol"] = ifcopenshell.util.unit.get_unit_symbol(unit) if quantity.is_a("IfcPhysicalSimpleQuantity"): measure_class = ( - quantity.declaration() + quantity.declaration .as_entity() .attribute_by_index(3) .type_of_attribute() diff --git a/src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.pyi b/src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.pyi index d7603c3c00..bf27a91f29 100644 --- a/src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.pyi +++ b/src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.pyi @@ -765,6 +765,7 @@ class entity_instance(entity_instance_mixin): file_: Any id_: Any def data(self, *args): ... + @property def declaration(self) -> declaration: ... def file_pointer(self): """Internal IfcFile pointer address. diff --git a/src/ifctester/ifctester/facet.py b/src/ifctester/ifctester/facet.py index cc50de57f4..5c05ae3cc4 100644 --- a/src/ifctester/ifctester/facet.py +++ b/src/ifctester/ifctester/facet.py @@ -749,7 +749,7 @@ class Property(Facet): ifcopenshell.util.unit.si_type_names[unit.UnitType], ) elif prop_entity.is_a("IfcPhysicalSimpleQuantity"): - prop_schema = prop_entity.declaration().as_entity() + prop_schema = prop_entity.declaration.as_entity() data_type = prop_schema.attribute_by_index(3).type_of_attribute().declared_type().name() if self.dataType and data_type.lower() != self.dataType.lower(): diff --git a/src/wrappergen/examples/print_walls.py b/src/wrappergen/examples/print_walls.py index 6d4c14f416..7ead197195 100644 --- a/src/wrappergen/examples/print_walls.py +++ b/src/wrappergen/examples/print_walls.py @@ -17,7 +17,7 @@ def main() -> int: model = ifx.file.with_path(sys.argv[1]) for wall in model.instances_by_type("IfcWall"): - print(f"#{wall.id()} {wall.declaration().name()}") + print(f"#{wall.id()} {wall.declaration.name()}") return 0