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

Action History managment (Undo/Redo)

2 REPLIES 2
Reply
Message 1 of 3
rBarland
1877 Views, 2 Replies

Action History managment (Undo/Redo)

Hi,

I make transactions to visualize some elements more clearly. For example, I make transparent walls to visualize some doors in 3D (previously selected).

After viewing, I made a new transaction to return the original display status of categories (Halftone, transparency, visibility).

 

So I have two problems:

- Before my transactions, I have to memorize the display status of the project to reset it after my transactions.

- These transactions are visible in the Undo/Redo functions of the interface.

 

Before each new viewing, I would like to execute the Undo function to put the project in his original state. This would allow me, firstly, not having to remember the view state, and secondly, not to generate a list of transactions visible in Undo/Redo features in Revit.

 

I did not find how to execute the Undo function. I did not find either how to disable action history management, which may be sufficient.

 

Do you have a solution for me?

2 REPLIES 2
Message 2 of 3
arnostlobel
in reply to: rBarland

rBarland:

There is no API for accessing the undo/redo commands. However, you can still "undo" your API transactions if you create them in a Transaction Group. A Transaction Group is an object that allows you managing transactions that have been started and committed within the group. Similarly to transactions, groups can also be either committed or rolled back (or assimilated, but that is an unrelated detail here). When you roll a transaction group back, all your transactions that have been submitted in that group will be undone. You can find more details in the API documentation of the TransactionGroup class in the RevitAPI.chm file in the SDK.

Arno?t
Arnošt Löbel
Message 3 of 3
rBarland
in reply to: arnostlobel

Alas, each transaction being in a specific IExternalCommand, I can not use TransactionGroup. thank you anyway.

Another idea?
For example, is it possible to change the categories display options without transaction?

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community