From 8e8b44a74436b2e3ed1f702a3764abb0d3af0381 Mon Sep 17 00:00:00 2001 From: falken10 Date: Tue, 3 Jun 2025 01:12:41 +0200 Subject: [PATCH] Resource should not increment quantity in cost schedule --- .../ifcopenshell/api/cost/assign_cost_item_quantity.py | 5 ++++- 1 file changed, 4 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 8ca6bf8559..aa11a3b209 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 @@ -154,5 +154,8 @@ class Usecase: if quantity.is_a("IfcQuantityCount"): count = 0 for rel in self.settings["cost_item"].Controls: - count += len(rel.RelatedObjects) + for obj in rel.RelatedObjects: + #Only increment if not a resource + if not obj.is_a("IfcConstructionResource"): + count +=1 quantity[3] = count