MSProject XML to IFC conversion now supports blank IFCs or non-existent work plans

This commit is contained in:
Dion Moult
2021-06-22 13:22:48 +10:00
parent 650ebeddd6
commit 2c49b3bde8
+8
View File
@@ -116,11 +116,19 @@ class MSP2Ifc:
}
def create_ifc(self):
if not self.file:
self.file = self.create_boilerplate_ifc()
if not self.work_plan:
self.work_plan = ifcopenshell.api.run("sequence.add_work_plan", self.file)
work_schedule = self.create_work_schedule()
self.create_tasks(work_schedule)
self.create_calendars()
self.create_rel_sequences()
def create_boilerplate_ifc(self):
self.file = ifcopenshell.file(schema="IFC4")
self.work_plan = self.file.create_entity("IfcWorkPlan")
def create_tasks(self, work_schedule):
for task_id in self.tasks:
task = self.tasks[task_id]