mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-19 03:33:48 +00:00
18 lines
672 B
Python
18 lines
672 B
Python
|
|
import ifcopenshell.api
|
||
|
|
|
||
|
|
|
||
|
|
class Usecase:
|
||
|
|
def __init__(self, file, **settings):
|
||
|
|
self.file = file
|
||
|
|
self.settings = {"cost_item": None, "cost_rate": None}
|
||
|
|
for key, value in settings.items():
|
||
|
|
self.settings[key] = value
|
||
|
|
|
||
|
|
def execute(self):
|
||
|
|
for cost_value in self.settings["cost_item"].CostValues:
|
||
|
|
ifcopenshell.api.run(
|
||
|
|
"cost.remove_cost_item_value", self.file, parent=self.settings["cost_item"], cost_value=cost_value
|
||
|
|
)
|
||
|
|
# This is an assumption, and not part of the official IFC documentation
|
||
|
|
self.settings["cost_item"].CostValues = self.settings["cost_rate"].CostValues
|