Improve support for Powerproject import (#1865)

This is tested with swedish PowerProject 14.0 file
This commit is contained in:
ecke101
2021-11-08 22:52:24 +01:00
committed by GitHub
parent ff6db5f24d
commit 7aa75d98d3
4 changed files with 63 additions and 26 deletions
@@ -1083,6 +1083,11 @@ class ImportP6(bpy.types.Operator, ImportHelper):
filename_ext = ".xml"
filter_glob: bpy.props.StringProperty(default="*.xml", options={"HIDDEN"})
@classmethod
def poll(cls, context):
ifc_file = IfcStore.get_file()
return ifc_file is not None
def execute(self, context):
from ifc4d.p62ifc import P62Ifc
@@ -1105,6 +1110,11 @@ class ImportP6XER(bpy.types.Operator, ImportHelper):
filename_ext = ".xer"
filter_glob: bpy.props.StringProperty(default="*.xer", options={"HIDDEN"})
@classmethod
def poll(cls, context):
ifc_file = IfcStore.get_file()
return ifc_file is not None
def execute(self, context):
from ifc4d.p6xer2ifc import P6XER2Ifc
@@ -1127,6 +1137,11 @@ class ImportPP(bpy.types.Operator, ImportHelper):
filename_ext = ".pp"
filter_glob: bpy.props.StringProperty(default="*.pp", options={"HIDDEN"})
@classmethod
def poll(cls, context):
ifc_file = IfcStore.get_file()
return ifc_file is not None
def execute(self, context):
from ifc4d.pp2ifc import PP2Ifc
@@ -1149,6 +1164,11 @@ class ImportMSP(bpy.types.Operator, ImportHelper):
filename_ext = ".xml"
filter_glob: bpy.props.StringProperty(default="*.xml", options={"HIDDEN"})
@classmethod
def poll(cls, context):
ifc_file = IfcStore.get_file()
return ifc_file is not None
def execute(self, context):
from ifc4d.msp2ifc import MSP2Ifc