Event when user closes a view

Event when user closes a view

DanielKP2Z9V
Advocate Advocate
244 Views
2 Replies
Message 1 of 3

Event when user closes a view

DanielKP2Z9V
Advocate
Advocate

Is there any way to run code when user closes a UIView? I've looked at DocumentChanged event, but neither Modified nor Deleted elements include UIViews. There is ViewActivated Event, but I don't see corresponding "ViewDeactivated Event".

 

This is necessary to keep track of currently opened UIViews, as output of GetOpenUIViews doesn't include sheets with activated views.

0 Likes
245 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

Yes, indeed. You need some creative ideas to address this. It can help to search for existing answers here in the forum:

  

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

DanielKP2Z9V
Advocate
Advocate

I've ended up writing custom function to close current view and close selected views. However, if user won't use them scripts will go out of sync. I thought about it for a long time, but there doesn't seem to be any way in Revit API to detect if user closes a view via Revit interface?

0 Likes