Implement feature for manipulating cost values, with support for calculation of subtotals

This commit is contained in:
Dion Moult
2021-04-26 18:18:42 +10:00
parent bfcc067257
commit 389076bff4
9 changed files with 307 additions and 18 deletions
@@ -0,0 +1,16 @@
import ifcopenshell.api
class Usecase:
def __init__(self, file, **settings):
self.file = file
self.settings = {"cost_item": None, "ifc_class": "IfcQuantityCount"}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
value = self.file.create_entity("IfcCostValue")
values = list(self.settings["cost_item"].CostValues or [])
values.append(value)
self.settings["cost_item"].CostValues = values
return value