From 97393eb173c79aa0b07ce97eabf95f44430c21cc Mon Sep 17 00:00:00 2001 From: myoualid Date: Wed, 11 Sep 2024 18:48:59 +0100 Subject: [PATCH] prevent spatial elements selection from being assigned to cost control --- .../ifcopenshell/api/cost/assign_cost_item_quantity.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/cost/assign_cost_item_quantity.py b/src/ifcopenshell-python/ifcopenshell/api/cost/assign_cost_item_quantity.py index a1c0b9a706..542347fa11 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/cost/assign_cost_item_quantity.py +++ b/src/ifcopenshell-python/ifcopenshell/api/cost/assign_cost_item_quantity.py @@ -104,12 +104,14 @@ class Usecase: if self.settings["prop_name"]: self.quantities = set(self.settings["cost_item"].CostQuantities or []) for product in self.settings["products"]: + if not product.is_a("IfcElement"): + continue self.assign_cost_control(related_object=product, cost_item=self.settings["cost_item"]) if self.settings["prop_name"]: if ( self.settings["cost_item"].CostQuantities and self.settings["cost_item"].CostQuantities[0].Name.lower() != self.settings["prop_name"].lower() - ) or not product.is_a("IfcObject"): + ): continue self.add_quantity_from_related_object(product) if self.settings["prop_name"]: