You can now count elements, tasks, and resources parametrically for cost items

This commit is contained in:
Dion Moult
2021-08-26 15:48:04 +10:00
parent 2cfa1d8bc0
commit 00f779fc49
7 changed files with 119 additions and 49 deletions
@@ -14,8 +14,10 @@ class Usecase:
# This is a bold assumption
# https://forums.buildingsmart.org/t/how-does-a-cost-item-know-that-it-is-counting-a-controlled-product/3564
if self.settings["ifc_class"] == "IfcQuantityCount" and self.settings["cost_item"].Controls:
count = 0
for rel in self.settings["cost_item"].Controls:
quantity[3] += len(rel.RelatedObjects)
count += len(rel.RelatedObjects)
quantity[3] = count
quantities = list(self.settings["cost_item"].CostQuantities or [])
quantities.append(quantity)
self.settings["cost_item"].CostQuantities = quantities