From ce26c6e19b9acca4e8a5abb70c2e88fd8e146210 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 15 Jan 2024 17:39:06 +0500 Subject: [PATCH] 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 --- src/blenderbim/blenderbim/bim/ui.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/ui.py b/src/blenderbim/blenderbim/bim/ui.py index b04b67e425..a1079f2096 100644 --- a/src/blenderbim/blenderbim/bim/ui.py +++ b/src/blenderbim/blenderbim/bim/ui.py @@ -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")