From cfd63392e7bbb27fb6b6b5809192b1aeb8fe9e90 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 16 Sep 2024 11:02:31 +0500 Subject: [PATCH] Add to recent projects when project is saved --- src/bonsai/bonsai/bim/module/project/operator.py | 2 ++ src/bonsai/bonsai/tool/project.py | 1 + 2 files changed, 3 insertions(+) diff --git a/src/bonsai/bonsai/bim/module/project/operator.py b/src/bonsai/bonsai/bim/module/project/operator.py index 42d254d5e3..7fe4506530 100644 --- a/src/bonsai/bonsai/bim/module/project/operator.py +++ b/src/bonsai/bonsai/bim/module/project/operator.py @@ -1320,6 +1320,8 @@ class ExportIFCBase: ifc_exporter.export() settings.logger.info("Export finished in {:.2f} seconds".format(time.time() - start)) print("Export finished in {:.2f} seconds".format(time.time() - start)) + # New project created in Bonsai should be in recent projects too. + tool.Project.add_recent_ifc_project(Path(output_file)) scene = context.scene if not scene.DocProperties.ifc_files: new = scene.DocProperties.ifc_files.add() diff --git a/src/bonsai/bonsai/tool/project.py b/src/bonsai/bonsai/tool/project.py index 936184181d..c309f88346 100644 --- a/src/bonsai/bonsai/tool/project.py +++ b/src/bonsai/bonsai/tool/project.py @@ -194,6 +194,7 @@ class Project(bonsai.core.tool.Project): If `filepath` was opened before, bump it in the list. """ + filepath = filepath.absolute() current_filepaths = cls.get_recent_ifc_projects() if filepath in current_filepaths: current_filepaths.remove(filepath)