mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 05:46:51 +00:00
Fix sequence data loading for unnamed items, ref #2783
This commit is contained in:
@@ -74,7 +74,7 @@ class SequenceData:
|
|||||||
def load_work_plans(cls):
|
def load_work_plans(cls):
|
||||||
cls.data["work_plans"] = {}
|
cls.data["work_plans"] = {}
|
||||||
for work_plan in tool.Ifc.get().by_type("IfcWorkPlan"):
|
for work_plan in tool.Ifc.get().by_type("IfcWorkPlan"):
|
||||||
data = {"Name": work_plan.Name}
|
data = {"Name": work_plan.Name or "Unnamed"}
|
||||||
data["IsDecomposedBy"] = []
|
data["IsDecomposedBy"] = []
|
||||||
for rel in work_plan.IsDecomposedBy:
|
for rel in work_plan.IsDecomposedBy:
|
||||||
data["IsDecomposedBy"].extend([o.id() for o in rel.RelatedObjects])
|
data["IsDecomposedBy"].extend([o.id() for o in rel.RelatedObjects])
|
||||||
@@ -86,6 +86,8 @@ class SequenceData:
|
|||||||
cls.data["work_schedules"] = {}
|
cls.data["work_schedules"] = {}
|
||||||
for work_schedule in tool.Ifc.get().by_type("IfcWorkSchedule"):
|
for work_schedule in tool.Ifc.get().by_type("IfcWorkSchedule"):
|
||||||
data = work_schedule.get_info()
|
data = work_schedule.get_info()
|
||||||
|
if not data["Name"]:
|
||||||
|
data["Name"] = "Unnamed"
|
||||||
del data["OwnerHistory"]
|
del data["OwnerHistory"]
|
||||||
if data["Creators"]:
|
if data["Creators"]:
|
||||||
data["Creators"] = [p.id() for p in data["Creators"]]
|
data["Creators"] = [p.id() for p in data["Creators"]]
|
||||||
@@ -109,6 +111,8 @@ class SequenceData:
|
|||||||
for work_calendar in tool.Ifc.get().by_type("IfcWorkCalendar"):
|
for work_calendar in tool.Ifc.get().by_type("IfcWorkCalendar"):
|
||||||
data = work_calendar.get_info()
|
data = work_calendar.get_info()
|
||||||
del data["OwnerHistory"]
|
del data["OwnerHistory"]
|
||||||
|
if not data["Name"]:
|
||||||
|
data["Name"] = "Unnamed"
|
||||||
data["WorkingTimes"] = [t.id() for t in work_calendar.WorkingTimes or []]
|
data["WorkingTimes"] = [t.id() for t in work_calendar.WorkingTimes or []]
|
||||||
data["ExceptionTimes"] = [t.id() for t in work_calendar.ExceptionTimes or []]
|
data["ExceptionTimes"] = [t.id() for t in work_calendar.ExceptionTimes or []]
|
||||||
cls.data["work_calendars"][work_calendar.id()] = data
|
cls.data["work_calendars"][work_calendar.id()] = data
|
||||||
|
|||||||
Reference in New Issue
Block a user