mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-19 11:43:53 +00:00
Implement feature for manipulating cost values, with support for calculation of subtotals
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user