Is there an ApplicationClosed Event for Revit C#?

Is there an ApplicationClosed Event for Revit C#?

rita.aguiar
Advocate Advocate
648 Views
4 Replies
Message 1 of 5

Is there an ApplicationClosed Event for Revit C#?

rita.aguiar
Advocate
Advocate

Just like there is a ApplicationInitialized Event to register when Revit was open, is there an ApplicationClosed Event to register when it has been closed?

If there isn't one, where should I look for to learn how to create it?

 

I know there is an ApplicationClosing Event, however, I would like to register only when Revit has been successfully closed (http://www.revitapidocs.com/2015/61068521-c216-3ab5-9d6e-28006fcfe0ae.htm).

 

Any help would be appretiated

0 Likes
Accepted solutions (1)
649 Views
4 Replies
Replies (4)
Message 2 of 5

aignatovich
Advisor
Advisor

Hi!

 

What about UIControlledApplication.ApplicationClosing event or IExternalApplication.OnShutdown?

0 Likes
Message 3 of 5

rita.aguiar
Advocate
Advocate

Thank you, I completely forgot I could use IExternalApplication.OnShutdown !

0 Likes
Message 4 of 5

rita.aguiar
Advocate
Advocate

On a side note, is IExternalApplication.OnShutdown to register when the plugin I created has been closed/disabled? Or when the Revit application has been closed?

0 Likes
Message 5 of 5

aignatovich
Advisor
Advisor
Accepted solution

According to documentation on IExternalApplication.OnShutdown method:

"Implement this method to execute some tasks when Autodesk Revit shuts down".

 

It won't be invoked if Revit crashes, only just before normal Revit shutdown/

0 Likes