From 9a6d1dfbd2073f0228dbf7da6db66ddd12a6e7f5 Mon Sep 17 00:00:00 2001 From: Zoe Forbes Date: Mon, 9 Feb 2026 18:40:18 -0600 Subject: [PATCH] fix: use Gui.Document.Modified instead of App.Document.Modified (#13) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit App.Document has no 'Modified' attribute — it only exists on Gui.Document. This caused every Silo save to fail with: Silo save failed: 'App.Document' object has no attribute 'Modified' The save itself succeeded but the modified flag was never cleared, so the document always appeared unsaved. --- freecad/silo_origin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/freecad/silo_origin.py b/freecad/silo_origin.py index e839551..5efe09c 100644 --- a/freecad/silo_origin.py +++ b/freecad/silo_origin.py @@ -392,8 +392,10 @@ class SiloOrigin: obj.SiloPartNumber, str(file_path), properties, comment="" ) - # Clear modified flag - doc.Modified = False + # Clear modified flag (Modified is on Gui.Document, not App.Document) + gui_doc = FreeCADGui.getDocument(doc.Name) + if gui_doc: + gui_doc.Modified = False return True except Exception as e: