mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 14:33:28 +00:00
Initial support for importing Primavera XER files (#1829)
* P6XML Parser failing on calendar type * add work plan references a get_person which is not an attribute. modified to get_user to work * Initial support for Primavera XER files Co-authored-by: Dion Moult <dion@thinkmoult.com>
This commit is contained in:
@@ -82,6 +82,7 @@ classes = (
|
||||
operator.UnassignProcess,
|
||||
operator.GenerateGanttChart,
|
||||
operator.ImportP6,
|
||||
operator.ImportP6XER,
|
||||
operator.ImportMSP,
|
||||
operator.LoadTaskProperties,
|
||||
operator.SelectTaskRelatedProducts,
|
||||
@@ -124,6 +125,7 @@ classes = (
|
||||
|
||||
def menu_func_import(self, context):
|
||||
self.layout.operator(operator.ImportP6.bl_idname, text="P6 (.xml)")
|
||||
self.layout.operator(operator.ImportP6XER.bl_idname, text="P6 (.xer)")
|
||||
self.layout.operator(operator.ImportMSP.bl_idname, text="Microsoft Project (.xml)")
|
||||
|
||||
|
||||
|
||||
@@ -1097,6 +1097,26 @@ class ImportP6(bpy.types.Operator, ImportHelper):
|
||||
print("Import finished in {:.2f} seconds".format(time.time() - start))
|
||||
return {"FINISHED"}
|
||||
|
||||
class ImportP6XER(bpy.types.Operator, ImportHelper):
|
||||
bl_idname = "import_p6xer.bim"
|
||||
bl_label = "Import P6 XER"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
filename_ext = ".xer"
|
||||
filter_glob: bpy.props.StringProperty(default="*.xer", options={"HIDDEN"})
|
||||
|
||||
def execute(self, context):
|
||||
from ifc4d.p6xer2ifc import P6XER2Ifc
|
||||
|
||||
self.file = IfcStore.get_file()
|
||||
start = time.time()
|
||||
p6xer2ifc = P6XER2Ifc()
|
||||
p6xer2ifc.xer = self.filepath
|
||||
p6xer2ifc.file = self.file
|
||||
p6xer2ifc.work_plan = self.file.by_type("IfcWorkPlan")[0] if self.file.by_type("IfcWorkPlan") else None
|
||||
p6xer2ifc.execute()
|
||||
Data.load(IfcStore.get_file())
|
||||
print("Import finished in {:.2f} seconds".format(time.time() - start))
|
||||
return {"FINISHED"}
|
||||
|
||||
class ImportMSP(bpy.types.Operator, ImportHelper):
|
||||
bl_idname = "import_msp.bim"
|
||||
|
||||
Reference in New Issue
Block a user