[Help] Accessing Document::isModified() from Python script

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
ndrs
Posts: 6
Joined: Thu Jan 18, 2018 11:14 am
Contact:

[Help] Accessing Document::isModified() from Python script

Post by ndrs »

Hi there!

I'm developing a GUI sofware bootstrapped by a Macro in FreeCAD, and I'm wondering how to access Document::isModified() from there.

So far I've tried:

Code: Select all

App.getDocument("myDocument").isModified()
as getDocument returns a Document object which has that function in the C++ source. However it seems there isn't a Python wrapper for that function.

Is there any way of accessing that property?

Thank you so much in advance.
DesignSPHysics developer and DualSPHysics mantainer.

DesignSPHysics Repo
DualSPHysics Repo
DualSPHysics Reference
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: [Help] Accessing Document::isModified() from Python script

Post by DeepSOIC »

Gui.ActiveDocument.Modified
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Help] Accessing Document::isModified() from Python script

Post by Kunda1 »

ndrs wrote: Thu Jan 18, 2018 11:20 am I'm developing a GUI sofware bootstrapped by a Macro in FreeCAD, and I'm wondering how to access Document::isModified() from there.
@ndrs are you referring to this?
https://github.com/ndrs92/DesignSPHysics
apropos: FC forum thread: Interesting project: DesignSPHysics fluid simulator
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
ndrs
Posts: 6
Joined: Thu Jan 18, 2018 11:14 am
Contact:

Re: [Help] Accessing Document::isModified() from Python script

Post by ndrs »

DeepSOIC wrote: Thu Jan 18, 2018 1:01 pm Gui.ActiveDocument.Modified
Thank you! Although I wanted to set the flag too. As far as I understand that's only the property that the GUI has access to, so if I want to force that a document is modified I guess I can't do it.

I'll try to investigate further.

Kunda1 wrote: Thu Jan 18, 2018 1:17 pm
ndrs wrote: Thu Jan 18, 2018 11:20 am I'm developing a GUI sofware bootstrapped by a Macro in FreeCAD, and I'm wondering how to access Document::isModified() from there.
@ndrs are you referring to this?
https://github.com/ndrs92/DesignSPHysics
apropos: FC forum thread: Interesting project: DesignSPHysics fluid simulator
Yes I am, that's what I'm developing. I'll try to keep up with the thread and help in whatever I can. Thanks!
DesignSPHysics developer and DualSPHysics mantainer.

DesignSPHysics Repo
DualSPHysics Repo
DualSPHysics Reference
Post Reply