Sub-transactions among multiple documents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
My question is about sub transactions.
I have designed an add-in that does something like the following:
-start transaction in doc
-make some changes
-scan the doc for placed family instances
-for each found family instance:
-go inside that family
-start transaction inside family
-make some changes
-scan the inside of the family for nested family instances
-for each found nested family
-go inside that nested family
-start transaction inside nested family
-make some changes
-commit transaction inside nested family
-load nested family back into family
-commit transaction inside family
-load family back into document
-commit transaction in doc
The way I have it now, is that all those transactions are separate transactions. So after the command is run, a whole bunch of commands appear under the undo-command button. However I would like to be able to undo this command with 1 press of the undo button.
I was thinking to use sub-transactions for this. But I was wondering if sub-transactions always have to be inside the same doc, or can it be among multiple docs, like in my example?
Furthermore I am struggling to find a good piece of example-code on sub-transactions. I found this, but I am not sure if I can use it, considering that the example executes on the same doc.
So my question is: How would the syntax about the main-transaction and sub-transactions be, based on the above example?
Thanks in advance.