Sketcher transactions

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Sketcher transactions

Post by microelly2 »

I play with sketches to get invalid configurations and roll back (undo) to the last version.
this works sometimes but not always.
Should undo/redo work in Sketch edit mode ? Then there are some bugs :roll: .
Otherwise i wonder what are ways to roll back from a corrupt sketch?

Is there a python method to paste and copy the whole sketch?

Is there a python way to get more information what causes the error in a sketch recalculation?
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Sketcher transactions

Post by DeepSOIC »

Undo should work.
Could you please describe step-by-step procedure of a failing undo?
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Sketcher transactions

Post by microelly2 »

DeepSOIC wrote:Undo should work.
Could you please describe step-by-step procedure of a failing undo?
Yes, then I will look how to track the failures.
wmayer
Founder
Posts: 20244
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Sketcher transactions

Post by wmayer »

Problems may occur when undoing/redoing changes while in edit mode. There are apparently some actions that don't reopen a new transaction after a change was committed.

Here a harmless issue:
  • add a line
  • create a length constraint
  • move the length constraint
When looking in the undo stack there is a transaction for the move of the constraint but when undoing it the constraint doesn't move back.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Sketcher transactions

Post by microelly2 »

wmayer wrote: When looking in the undo stack there is a transaction for the move of the constraint but when undoing it the constraint doesn't move back.
Can i look from python into the transaction stack?

Does it make sense to leave the edit mode and reenter it after every change?
wmayer
Founder
Posts: 20244
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Sketcher transactions

Post by wmayer »

Can i look from python into the transaction stack?

Code: Select all

App.ActiveDocument.UndoNames
Does it make sense to leave the edit mode and reenter it after every change?
No! This will make it quite inefficient.
Post Reply