From f9a0081b33b6d865570c16f33e5af44269e3427b Mon Sep 17 00:00:00 2001 From: Massimo Fabbro Date: Fri, 25 Apr 2025 09:07:40 +0200 Subject: [PATCH] Fix bug in reload link ifc where in Windows gives an error if relative path is used --- src/bonsai/bonsai/bim/module/project/operator.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/project/operator.py b/src/bonsai/bonsai/bim/module/project/operator.py index d7904f1109..63e7ced454 100644 --- a/src/bonsai/bonsai/bim/module/project/operator.py +++ b/src/bonsai/bonsai/bim/module/project/operator.py @@ -1437,12 +1437,11 @@ class ReloadLink(bpy.types.Operator): filepath: bpy.props.StringProperty() def execute(self, context): - filepath = Path(self.filepath) is_abs = os.path.isabs(Path(self.filepath)) use_relative_path = not is_abs bpy.ops.bim.unlink_ifc(filepath=self.filepath) - status = bpy.ops.bim.link_ifc(filepath=self.filepath, use_cache=False, use_relative_path=use_relative_path) - + filepath = tool.Ifc.resolve_uri(self.filepath) + status = bpy.ops.bim.link_ifc(filepath=filepath, use_cache=False, use_relative_path=use_relative_path) return {"FINISHED"}