From 3c32c9b6ed0e1112745f823a019e7105caaf62d9 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 14 Nov 2024 17:45:45 +0500 Subject: [PATCH] ConvertPropertiesToQuantities - ifc4x3 support --- .../ifcpatch/recipes/ConvertPropertiesToQuantities.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ifcpatch/ifcpatch/recipes/ConvertPropertiesToQuantities.py b/src/ifcpatch/ifcpatch/recipes/ConvertPropertiesToQuantities.py index 105d2d59e2..48482821e2 100644 --- a/src/ifcpatch/ifcpatch/recipes/ConvertPropertiesToQuantities.py +++ b/src/ifcpatch/ifcpatch/recipes/ConvertPropertiesToQuantities.py @@ -67,7 +67,11 @@ class Patcher: def patch(self) -> None: self.qto_template_cache: dict[str, list[ifcopenshell.entity_instance]] = {} - self.psetqto = ifcopenshell.util.pset.get_template("IFC4") + templates_schema = self.file.schema + # No official qto templates in IFC2X3, fallback to IFC4. + if templates_schema == "IFC2X3": + templates_schema = "IFC4" + self.psetqto = ifcopenshell.util.pset.get_template(templates_schema) for product in self.file.by_type("IfcTypeProduct"): self.process_product(product, product.HasPropertySets or [])