where is storage of undo

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
imanipourmeysam
Posts: 23
Joined: Thu Nov 18, 2021 2:41 pm

where is storage of undo

Post by imanipourmeysam »

Hi,
I wanted to know where the information of Do/Undo mechanism is stored when we are designing.
For example, when I design something I have a list of tools and command I did during the design as you see in the picture.

I wanted to know if we can access these data or save them into a macro or something similar.
Because when we save our file and open it again, all these data of undo and redo will be removed, and we can't access them.

I need to do this for my research goal and up to now I was trying to record macro and re-execute it again, but the ideal method is to save undo/redo data and them being able to run them again even after the file is saved.
Thank you.
Attachments
Capture.JPG
Capture.JPG (28.91 KiB) Viewed 1452 times
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: where is storage of undo

Post by TheMarkster »

doc.UndoNames

But it's just a list of strings. I don't know of any way to get the actual transaction history.
mario52
Veteran
Posts: 4698
Joined: Wed May 16, 2012 2:13 pm

Re: where is storage of undo

Post by mario52 »

Hi

with Std_DlgMacroRecord Image save all step of construction in a macro

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
imanipourmeysam
Posts: 23
Joined: Thu Nov 18, 2021 2:41 pm

Re: where is storage of undo

Post by imanipourmeysam »

mario52 wrote: Tue Jan 11, 2022 9:38 pm Hi

with Std_DlgMacroRecord Image save all step of construction in a macro

mario
Yes but the thing with macro record is that you can't separate your steps properly.
if you execute the recorded macro you will go to last step instantly.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: where is storage of undo

Post by wmayer »

I wanted to know where the information of Do/Undo mechanism is stored when we are designing.
It's stored in the document -- the class name is App::Document. Internally it uses two lists of App::Transaction objects that keep the actual changes.
However, transaction are encapsulated in the document and there is no way from outside to manipulate them. All what you can get is the list of undo/redo descriptions.
I wanted to know if we can access these data or save them into a macro or something similar.
No, you can't.
mario52
Veteran
Posts: 4698
Joined: Wed May 16, 2012 2:13 pm

Re: where is storage of undo

Post by mario52 »

Hi
imanipourmeysam wrote: Wed Jan 12, 2022 6:56 am if you execute the recorded macro you will go to last step instantly.
yes if your execute as is , but if you create one pause betwen 2 step , you modify the code as you want

just idea

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
Post Reply