From 9c78ced00c67a6c2554d8fbfbeb84282a90d3363 Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Tue, 9 Dec 2025 00:02:34 +0100 Subject: [PATCH] CAM: Made Fanuc post processor compatible with FreeCAD 1.1. Use setPlainText() if available, otherwise use setText(). Workaround for a regression from #23862. --- src/Mod/CAM/Path/Post/scripts/fanuc_post.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Mod/CAM/Path/Post/scripts/fanuc_post.py b/src/Mod/CAM/Path/Post/scripts/fanuc_post.py index 6a466f474c..399de11221 100644 --- a/src/Mod/CAM/Path/Post/scripts/fanuc_post.py +++ b/src/Mod/CAM/Path/Post/scripts/fanuc_post.py @@ -352,7 +352,13 @@ def export(objectslist, filename, argstring): if FreeCAD.GuiUp and SHOW_EDITOR: dia = PostUtils.GCodeEditorDialog() - dia.editor.setPlainText(gcode) + + # Workaround for 1.1 while we wait for + # https://github.com/FreeCAD/FreeCAD/pull/26008 to be merged. + if hasattr(dia.editor, "setPlainText"): + dia.editor.setPlainText(gcode) + else: + dia.editor.setText(gcode) result = dia.exec_() if result: final = dia.editor.toPlainText()