From 3fcb684326aa6f5fa5895e33e7007c0ea2eab4ae Mon Sep 17 00:00:00 2001 From: Alex Facciorusso Date: Wed, 14 Aug 2024 17:34:49 +0100 Subject: [PATCH] FIX: empty filename in CAM workbench saves to the current project folder Previously, if the user didn't set a default gcode path, the file was saved to getcwd. Now, it attempts to take the active document's path first. --- src/Mod/CAM/Path/Post/Utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mod/CAM/Path/Post/Utils.py b/src/Mod/CAM/Path/Post/Utils.py index 1c27e45747..ad547bd70f 100644 --- a/src/Mod/CAM/Path/Post/Utils.py +++ b/src/Mod/CAM/Path/Post/Utils.py @@ -88,7 +88,10 @@ class FilenameGenerator: filename = FreeCAD.ActiveDocument.Label if not outputpath: - outputpath = os.getcwd() + outputpath, _ = os.path.split(FreeCAD.ActiveDocument.getFileName()) + + if not outputpath: + outputpath = os.getcwd() ## TODO: This should be avoided as it would give the Freecad executable's path if not ext: ext = ".nc"