mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 09:05:18 +00:00
Allow rooted tasks when exporting schedules to P6XML
This commit is contained in:
@@ -125,7 +125,7 @@ class Ifc2P6:
|
|||||||
6: "Saturday",
|
6: "Saturday",
|
||||||
7: "Sunday",
|
7: "Sunday",
|
||||||
}
|
}
|
||||||
for working_time in calendar.WorkingTimes:
|
for working_time in calendar.WorkingTimes or []:
|
||||||
if not working_time.RecurrencePattern or working_time.RecurrencePattern.RecurrenceType != "WEEKLY":
|
if not working_time.RecurrencePattern or working_time.RecurrencePattern.RecurrenceType != "WEEKLY":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -211,8 +211,6 @@ class Ifc2P6:
|
|||||||
self.create_activity(activity["task"], activity["work_schedule"], parent=activity["parent"])
|
self.create_activity(activity["task"], activity["work_schedule"], parent=activity["parent"])
|
||||||
|
|
||||||
def create_activity(self, task, work_schedule, parent=None):
|
def create_activity(self, task, work_schedule, parent=None):
|
||||||
if not parent:
|
|
||||||
return
|
|
||||||
activity = ET.SubElement(self.element_map[work_schedule], "Activity")
|
activity = ET.SubElement(self.element_map[work_schedule], "Activity")
|
||||||
self.link_element(task, activity)
|
self.link_element(task, activity)
|
||||||
ET.SubElement(activity, "Id").text = task.Identification or "X"
|
ET.SubElement(activity, "Id").text = task.Identification or "X"
|
||||||
|
|||||||
Reference in New Issue
Block a user