From 3507920c09707817fa5c18e75070890f845ed4cd Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 8 Jun 2022 19:09:55 +1000 Subject: [PATCH] #2224 Expose unload project in UI to aid in unlinking IFCs for coordination only --- src/blenderbim/blenderbim/bim/module/project/ui.py | 1 + src/blenderbim/scripts/headless_import.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/project/ui.py b/src/blenderbim/blenderbim/bim/module/project/ui.py index 11fbdb13a6..0940bbc69f 100644 --- a/src/blenderbim/blenderbim/bim/module/project/ui.py +++ b/src/blenderbim/blenderbim/bim/module/project/ui.py @@ -165,6 +165,7 @@ class BIM_PT_project(Panel): op.should_save_as = False op = row.operator("export_ifc.bim", icon="FILE_TICK", text="Save As") op.should_save_as = True + row.operator("bim.unload_project", text="", icon="X") def draw_create_project_ui(self, context): props = context.scene.BIMProperties diff --git a/src/blenderbim/scripts/headless_import.py b/src/blenderbim/scripts/headless_import.py index 9f69c76937..07596d6c08 100644 --- a/src/blenderbim/scripts/headless_import.py +++ b/src/blenderbim/scripts/headless_import.py @@ -48,8 +48,7 @@ props.element_limit = 30000 bpy.ops.bim.load_project(filepath="/path/to/your/model/input.ifc") # In coordination mode, it is unnecessary to maintain a link to the IFC -bpy.context.scene.BIMProperties.ifc_file = "" -IfcStore.file = None +bpy.ops.bim.unload_project() # Save the processed file here bpy.ops.wm.save_mainfile(filepath="/path/to/your/model/output.blend")