The new event
UIApplication.Idling is raised when it
is safe for the API application to access the active document between user
interactions. The event is raised only when the Revit UI is in a state where
the user could successfully click on an API command button. We are adding an
Application.OnIdle event so that when the application is not being used by
the user, or when the user is not moving the mouse around or interacting with
elements, etc, you can do something. So Revit will tell you that it is not
busy at the moment and we can do certain operations. For example around the
sustainable design and analysis context, when we get to know that Revit is
idle, we can have some functionality added to update some database or
analysis model based on changes that have occurred in the model and were
tracked by the element events. Revit internally will make sure when it raises
this event so that the model does not get corrupted by doing something when
it is not available. The event allows changes to a document if a new
transaction is opened. |
|
There are also some
safety considerations. Because this event is invoked between user actions in
the Revit UI, if the handler for this event requires a significant amount of
processing time, users will perceive a slowdown in the responsiveness of
Revit. If the execution for updates can be safely split across multiple calls
to this event, the user perception of Revit responsiveness will be improved. |
|