Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Transaction/Undo/Redo

4 REPLIES 4
Reply
Message 1 of 5
alexisDVJML
315 Views, 4 Replies

Transaction/Undo/Redo

Navisworks Transactions are wonderful.
By using them to enclose multiple actions modifying the document, not only you gain an incredible speedup, but you also the user to Undo all of them at once.

Kuddos to Navisworks team for this and for supporting multi-level Undo/Redo.

This is a challenging thing to implement so again Kuddos for this (and yes I blame but I also compliment where due ;->)

 

Now my question:
While I cleanly encapsulate our plugin important action into a transaction, most of these also modify the plugin internal state.
Thus if user "Undo", we end up in inconsistent state.

As a workaround for now, for such operation that modify internal state, I also enclose it in a paired document StartDisableUndo/EndDisableUndo.

However ideally I would like to intercept the Undo/Redo to do our own stuff.

But I didn't find any dedicated event to attach to.
Any clue anyone?

Thanks.

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go
4 REPLIES 4
Message 2 of 5

Hi,

 

I raised your issue to the Navisworks Engineering team and asked for their suggestion.

I will come back to you if I receive any response from the engineering team.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

Message 3 of 5
alexisDVJML
in reply to: alexisDVJML

Thanks!

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go
Message 4 of 5

Any update?

 

I also have a related question re: Transaction, aka re: Document BeginTransaction, EndTransaction and IsActiveTransaction.

 

My asumption is transactions are single level aka we cannot have a transaction created inside a transaction?

In such case, provided I want to have generic methods that can be called either with a currently running transaction or not, I should/could check IsActiveTransaction and if true NOT create a transaction?

 

Also how this relate to Undo methods which are at least counted and thus support kind of multi-level?

 

Thanks.

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go
Message 5 of 5
alexisDVJML
in reply to: alexisDVJML

Additional question: is there any recommandations/guidelines re: order of BeginProgress and BeginStransaction? Which one preferably to call first to begin and call last to end a Transaction, and does it make any difference at all?

 

Thanks.

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report