FEature to import Microsoft Project .xml Schedules and convert to IFC schema

This commit is contained in:
bosonprojets
2021-05-06 02:40:04 +00:00
parent a031bffe6c
commit d19d4fca3e
3 changed files with 229 additions and 0 deletions
@@ -61,6 +61,7 @@ classes = (
operator.UnassignProduct,
operator.GenerateGanttChart,
operator.ImportP6,
operator.ImportMSP,
operator.LoadTaskProperties,
operator.SelectTaskRelatedProducts,
operator.VisualiseWorkScheduleDate,
@@ -82,6 +83,7 @@ classes = (
def menu_func_import(self, context):
self.layout.operator(operator.ImportP6.bl_idname, text="P6 (.xml)")
self.layout.operator(operator.ImportMSP.bl_idname, text="Microsoft Project (.xml)")
def register():
@@ -868,6 +868,26 @@ class ImportP6(bpy.types.Operator, ImportHelper):
print("Import finished in {:.2f} seconds".format(time.time() - start))
return {"FINISHED"}
class ImportMSP(bpy.types.Operator, ImportHelper):
bl_idname = "import_msp.bim"
bl_label = "Import MSP"
filename_ext = ".xml"
filter_glob: bpy.props.StringProperty(default="*.xml", options={"HIDDEN"})
def execute(self, context):
from ifcp6.msp2ifc import MSP2Ifc
self.file = IfcStore.get_file()
start = time.time()
msp2ifc = MSP2Ifc()
msp2ifc.xml = self.filepath
msp2ifc.file = self.file
msp2ifc.work_plan = self.file.by_type("IfcWorkPlan")[0] if self.file.by_type("IfcWorkPlan") else None
msp2ifc.execute()
Data.load(IfcStore.get_file())
print("Import finished in {:.2f} seconds".format(time.time() - start))
return {"FINISHED"}
class EnableEditingWorkCalendarTimes(bpy.types.Operator):
bl_idname = "bim.enable_editing_work_calendar_times"