From c98c20d40369372277afc2e34ff25ce3dc1fe3d5 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sun, 20 Aug 2023 20:50:32 +1000 Subject: [PATCH] Fix #3583. BaseQuantity QTOs in IFC4 can now be set on types. --- src/ifcopenshell-python/ifcopenshell/util/pset.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/util/pset.py b/src/ifcopenshell-python/ifcopenshell/util/pset.py index dcb816e06f..1690d29b43 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/pset.py +++ b/src/ifcopenshell-python/ifcopenshell/util/pset.py @@ -48,6 +48,12 @@ class PsetQto: folder_path = pathlib.Path(__file__).parent.absolute() path = str(folder_path.joinpath("schema", self.templates_path[schema])) templates = [ifcopenshell.open(path)] + # See bug 3583. We backport this change from IFC4X3 because it just makes sense. + # Users aren't forced to use it. + if schema == "IFC4": + for element in templates[0].by_type("IfcPropertySetTemplate"): + if element.TemplateType == "QTO_OCCURRENCEDRIVEN": + element.TemplateType = "QTO_TYPEDRIVENOVERRIDE" self.templates = templates @lru_cache()