From 3911f51d89f3e2056962fd68a8e5196fb1ae83af Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 14 Nov 2024 16:58:11 +0500 Subject: [PATCH] Fix broken ConvertPropertiesToQuantities #5747 Name and Properties arguments were renamed and lowercased. --- .../ifcpatch/recipes/ConvertPropertiesToQuantities.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ifcpatch/ifcpatch/recipes/ConvertPropertiesToQuantities.py b/src/ifcpatch/ifcpatch/recipes/ConvertPropertiesToQuantities.py index e432c26255..abd9a2110f 100644 --- a/src/ifcpatch/ifcpatch/recipes/ConvertPropertiesToQuantities.py +++ b/src/ifcpatch/ifcpatch/recipes/ConvertPropertiesToQuantities.py @@ -18,6 +18,7 @@ import ifcopenshell import ifcopenshell.api +import ifcopenshell.api.pset import ifcopenshell.util.pset import ifcopenshell.util.element from logging import Logger @@ -96,10 +97,8 @@ class Patcher: if value and not has_quantity: qto_name = self.get_qto_name(product.is_a()) - qto = qtos.get(qto_name, ifcopenshell.api.run("pset.add_qto", self.file, product=product, Name=qto_name)) - ifcopenshell.api.run( - "pset.edit_qto", self.file, qto=qto, Properties={self.destination_quantity_name: value} - ) + qto = qtos.get(qto_name, ifcopenshell.api.pset.add_qto(self.file, product=product, name=qto_name)) + ifcopenshell.api.pset.edit_qto(self.file, qto=qto, properties={self.destination_quantity_name: value}) def get_qto_name(self, ifc_class: str) -> Union[str, None]: for template in self.get_qto_templates(ifc_class):