diff --git a/src/ifcp6/ifcp6/msp2ifc.py b/src/ifcp6/ifcp6/msp2ifc.py index 1f8d86e2e6..29cc744d8a 100644 --- a/src/ifcp6/ifcp6/msp2ifc.py +++ b/src/ifcp6/ifcp6/msp2ifc.py @@ -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]