CAM: fix philips postprocessor always writing to "-" instead of specified file and not processing arguments

This commit is contained in:
jffmichi
2025-05-20 05:04:03 +02:00
parent 08cba3fa45
commit 09e356cec6

View File

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