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.
This commit is contained in:
Alex Facciorusso
2024-08-14 17:34:49 +01:00
committed by sliptonic
parent b3a5882b9a
commit d3e92037b9

View File

@@ -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"