Assign control to cost items and UX Workschedules and Costchedules cleanup

This commit is contained in:
bosonprojets
2021-04-22 00:18:22 +00:00
parent 78314b1ec7
commit 8b35a3aadd
12 changed files with 502 additions and 272 deletions
@@ -38,7 +38,10 @@ class Data:
del data["CostValues"]
del data["CostQuantities"]
data["RelatedObjects"] = []
data["Controls"] = []
for rel in cost_item.IsNestedBy:
[data["RelatedObjects"].append(o.id()) for o in rel.RelatedObjects if o.is_a("IfcCostItem")]
for rel in cost_item.Controls:
[data["Controls"].append(o.id()) for o in rel.RelatedObjects or []]
cls.cost_items[cost_item.id()] = data
cls.is_loaded=True
@@ -0,0 +1,10 @@
class Usecase:
def __init__(self, file, **settings):
self.file = file
self.settings = {"cost_item": None, "attributes": {}}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
for name, value in self.settings["attributes"].items():
setattr(self.settings["cost_item"], name, value)