mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 19:30:25 +00:00
18 lines
603 B
Python
18 lines
603 B
Python
|
|
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):
|
||
|
|
quantity = self.file.create_entity(self.settings["ifc_class"], Name="Unnamed")
|
||
|
|
quantity[3] = 0.0
|
||
|
|
quantities = list(self.settings["cost_item"].CostQuantities or [])
|
||
|
|
quantities.append(quantity)
|
||
|
|
self.settings["cost_item"].CostQuantities = quantities
|
||
|
|
return quantity
|