mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Feature to create IfcTask trees for entities of IfcWorkSchedule
This commit is contained in:
@@ -61,6 +61,7 @@ class Data:
|
||||
|
||||
@classmethod
|
||||
def load_work_calendars(cls):
|
||||
cls.work_calendars = {}
|
||||
for work_calendar in cls._file.by_type("IfcWorkCalendar"):
|
||||
data = work_calendar.get_info()
|
||||
del data["OwnerHistory"]
|
||||
@@ -72,4 +73,9 @@ class Data:
|
||||
def load_tasks(cls):
|
||||
cls.tasks = {}
|
||||
for task in cls._file.by_type("IfcTask"):
|
||||
cls.tasks[task.id()] = {"Name": task.Name, "Identification": task.Identification or ""}
|
||||
data = task.get_info()
|
||||
del data["OwnerHistory"]
|
||||
data["RelatedObjects"] = []
|
||||
for rel in task.IsNestedBy:
|
||||
[data["RelatedObjects"].append(o.id()) for o in rel.RelatedObjects if o.is_a("IfcTask")]
|
||||
cls.tasks[task.id()] = data
|
||||
|
||||
Reference in New Issue
Block a user