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"