diff --git a/src/ifcopenshell-python/ifcopenshell/util/unit.py b/src/ifcopenshell-python/ifcopenshell/util/unit.py index 45905ca595..ec3c2513d3 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/unit.py +++ b/src/ifcopenshell-python/ifcopenshell/util/unit.py @@ -795,7 +795,7 @@ def is_attr_type( def iter_element_and_attributes_per_type( ifc_file: ifcopenshell.file, attr_type_name: str ) -> Iterable[tuple[ifcopenshell.entity_instance, ifcopenshell_wrapper.attribute, Any]]: - schema: ifcopenshell_wrapper.schema_definition = ifcopenshell_wrapper.schema_by_name(ifc_file.schema) + schema: ifcopenshell_wrapper.schema_definition = ifcopenshell_wrapper.schema_by_name(ifc_file.schema_identifier) for element in ifc_file: entity = schema.declaration_by_name(element.is_a()) diff --git a/src/ifcopenshell-python/test/fixtures/units/beam-standard-case.ifc b/src/ifcopenshell-python/test/fixtures/units/beam-standard-case.ifc index 0f506b45a4..e96f5cd6ee 100644 --- a/src/ifcopenshell-python/test/fixtures/units/beam-standard-case.ifc +++ b/src/ifcopenshell-python/test/fixtures/units/beam-standard-case.ifc @@ -2,7 +2,7 @@ ISO-10303-21; HEADER; FILE_DESCRIPTION((''),'2;1'); FILE_NAME('','2019-03-20T15:56:44',(''),(''),'BuildingSmart IfcKit by Constructivity','IfcDoc 12.0.0.0',''); -FILE_SCHEMA(('IFC4x1')); +FILE_SCHEMA(('IFC4X3_ADD2')); ENDSEC; DATA; diff --git a/src/ifcopenshell-python/test/test_file.py b/src/ifcopenshell-python/test/test_file.py index af4decdc82..60b9688f86 100644 --- a/src/ifcopenshell-python/test/test_file.py +++ b/src/ifcopenshell-python/test/test_file.py @@ -166,10 +166,10 @@ class TestFile(test.bootstrap.IFC4): assert f.schema_version == (4, 3, 2, 0) def test_creating_a_specific_version(self): - f = ifcopenshell.file(schema_version=(4, 3, 1, 0)) + f = ifcopenshell.file(schema_version=(4, 3, 2, 0)) assert f.schema == "IFC4X3" - assert f.schema_identifier == "IFC4X3_ADD1" - assert f.schema_version == (4, 3, 1, 0) + assert f.schema_identifier == "IFC4X3_ADD2" + assert f.schema_version == (4, 3, 2, 0) def test_creating_an_entity(self): element = self.file.create_entity("IfcPerson")