From 09e356cec67eea0fb84fe71f889ae30511c596ca Mon Sep 17 00:00:00 2001 From: jffmichi <> Date: Tue, 20 May 2025 05:04:03 +0200 Subject: [PATCH] CAM: fix philips postprocessor always writing to "-" instead of specified file and not processing arguments --- src/Mod/CAM/Path/Post/scripts/philips_post.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Mod/CAM/Path/Post/scripts/philips_post.py b/src/Mod/CAM/Path/Post/scripts/philips_post.py index 3389302605..373c2f3475 100644 --- a/src/Mod/CAM/Path/Post/scripts/philips_post.py +++ b/src/Mod/CAM/Path/Post/scripts/philips_post.py @@ -352,6 +352,7 @@ def linenumberify(GCodeString): def export(objectslist, filename, argstring): + processArguments(argstring) global UNITS global linenr @@ -584,8 +585,16 @@ def export(objectslist, filename, argstring): lastcommand = c.Name gcode = gcode.replace("_", "-") gcode += linenumberify(GCODE_FOOTER) - if SHOW_EDITOR: - PostUtils.editor(gcode) - gfile = pyopen(filename, "w") - gfile.write(gcode) - gfile.close() + + # show the gCode result dialog + if FreeCAD.GuiUp and SHOW_EDITOR: + final = PostUtils.editor(gcode) + else: + final = gcode + + if not filename == "-": + gfile = pyopen(filename, "w") + gfile.write(final) + gfile.close() + + return final