BBIM - upgrade to IFC4X3 on loading projects

Added "Upgrate to IFC4X3" button on loading new projects to migrate them to IFC4x3 as Ifc4x3 got approved now will be used more widely.

https://i.imgur.com/mHSIV7T.png
This commit is contained in:
Andrej730
2024-01-15 17:39:06 +05:00
parent 8728fa38b9
commit ce26c6e19b
+14 -10
View File
@@ -65,16 +65,20 @@ class IFCFileSelector:
split = box.split()
split.label(text=key.title().replace("_", " "))
split.label(text=str(value))
if (
key.lower() == "schema_name"
and str(value).lower() == "ifc2x3"
and filepath[-4:].lower() == ".ifc"
):
row = box.row()
op = row.operator("bim.run_migrate_patch", text="Upgrade to IFC4")
op.infile = filepath
op.outfile = filepath[0:-4] + "-IFC4.ifc"
op.schema = "IFC4"
if key.lower() == "schema_name" and filepath[-4:].lower() == ".ifc":
schema_lower = str(value).lower()
if schema_lower == "ifc2x3":
row = box.row()
op = row.operator("bim.run_migrate_patch", text="Upgrade to IFC4")
op.infile = filepath
op.outfile = filepath[0:-4] + "-IFC4.ifc"
op.schema = "IFC4"
elif schema_lower == "ifc4":
row = box.row()
op = row.operator("bim.run_migrate_patch", text="Upgrade to IFC4X3")
op.infile = filepath
op.outfile = filepath[0:-4] + "-IFC4X3.ifc"
op.schema = "IFC4X3"
if bpy.data.is_saved:
layout.prop(self, "use_relative_path")