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: 

Undo Event

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Moustafa_K
2008 Views, 2 Replies

Undo Event

Hi!

Is there any method to capture the undo event? or any other for triggering a method on undo?

 

Why? the story is like this:

i have created an Addin with a button, this button is changeable ie. if preseed { change the image, text of the button} if pressed again{revert the old image,Text back}

 

however, when you trigger and make the idlying issue Activated and you Hit (Ctrl+Z) for undo the button is not reverted. ofcourse it will not because there is nothing call it to do so.

 

so is there a way for that

 

 

 


-----------------------------------------------------
Moustafa Khalil
Tags (1)
2 REPLIES 2
Message 2 of 3
arnostlobel
in reply to: Moustafa_K

Hello mostafa90:

 

A simple answer (without referring to your concrete implementation) is yes – there is an event for Undo and Redo operations. It is the same event like the one for document changes – DocumentChanged. The “Operation” property on the event’s argument will tell you whether the change was caused by an undo or something else.

 

Thank you

 

Arnošt Löbel

Autodesk, Revit R&D

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

thanks aarnostobel,
although as you said not hitting my concrete implementation, i was missunderstanding the ctrl+z vs ideling.

the idling once started by button it will not get back to the previous process unless it was ordered to do so. and this can also be done via DocumentChanged Event.

thanks for lighting me up.
Problem solved.

-----------------------------------------------------
Moustafa Khalil

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