mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 06:47:57 +00:00
Fix broken ConvertPropertiesToQuantities #5747
Name and Properties arguments were renamed and lowercased.
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
import ifcopenshell
|
import ifcopenshell
|
||||||
import ifcopenshell.api
|
import ifcopenshell.api
|
||||||
|
import ifcopenshell.api.pset
|
||||||
import ifcopenshell.util.pset
|
import ifcopenshell.util.pset
|
||||||
import ifcopenshell.util.element
|
import ifcopenshell.util.element
|
||||||
from logging import Logger
|
from logging import Logger
|
||||||
@@ -96,10 +97,8 @@ class Patcher:
|
|||||||
|
|
||||||
if value and not has_quantity:
|
if value and not has_quantity:
|
||||||
qto_name = self.get_qto_name(product.is_a())
|
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))
|
qto = qtos.get(qto_name, ifcopenshell.api.pset.add_qto(self.file, product=product, name=qto_name))
|
||||||
ifcopenshell.api.run(
|
ifcopenshell.api.pset.edit_qto(self.file, qto=qto, properties={self.destination_quantity_name: value})
|
||||||
"pset.edit_qto", self.file, qto=qto, Properties={self.destination_quantity_name: value}
|
|
||||||
)
|
|
||||||
|
|
||||||
def get_qto_name(self, ifc_class: str) -> Union[str, None]:
|
def get_qto_name(self, ifc_class: str) -> Union[str, None]:
|
||||||
for template in self.get_qto_templates(ifc_class):
|
for template in self.get_qto_templates(ifc_class):
|
||||||
|
|||||||
Reference in New Issue
Block a user