mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 17:57:02 +00:00
MSProject XML to IFC conversion now supports blank IFCs or non-existent work plans
This commit is contained in:
@@ -116,11 +116,19 @@ class MSP2Ifc:
|
|||||||
}
|
}
|
||||||
|
|
||||||
def create_ifc(self):
|
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()
|
work_schedule = self.create_work_schedule()
|
||||||
self.create_tasks(work_schedule)
|
self.create_tasks(work_schedule)
|
||||||
self.create_calendars()
|
self.create_calendars()
|
||||||
self.create_rel_sequences()
|
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):
|
def create_tasks(self, work_schedule):
|
||||||
for task_id in self.tasks:
|
for task_id in self.tasks:
|
||||||
task = self.tasks[task_id]
|
task = self.tasks[task_id]
|
||||||
|
|||||||
Reference in New Issue
Block a user