mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-16 18:44:47 +00:00
You can now count elements, tasks, and resources parametrically for cost items
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user