Closed rompik closed 2 years ago
PipeCad.StartTransaction("Some comment")
PipeCad.CommitTransaction()
The start/commit transaction will combine all modification into one command for undo/redo. It is not needed before doing any modification just when you think that all the modification can be undo/redo once.
Ok, understand. Not sure that developers will use it for scripts (it's only my experience), but in any way lets remains "as is":)
PipeCad.StartTransaction("Some comment")
PipeCad.CommitTransaction()
Like in PDMS use macro:
MARKDB 'text'
ENDMARKDB
I think developers will use it when they want to combine all modification in one undo/redo.
Didn't know about such possibility in PDMS. Usually undo/redo mechanism was horrible in PDMS, so we tried to don't use it.
Okay.
Before doing any modification in Python code there is need to open session and after close and save it. But I think as starting/committing of transaction is required for proper writing to database will be better to merge 3 operation into one and hide it in the Core method. So Python code will be changed from:
to just savework:
So when user open PipeCAD, Core will start transaction automatically. When user want to save changes, he will use only command PipeCAD.Savework() and Core will COMMIT TRANSACTION, do SAVEWORK and START new TRANSACTION in the one Core's method PipeCAD.Savework() automatically.