Hi all, I have a pretty straight forward question.
As the post title suggests, is there a way to listen for when the active view changes?
The closest thing I can come up with is getting all open UI views but that's not exactly a listener.
Solved! Go to Solution.
Solved by TorsionTools. Go to Solution.
Solved by RPTHOMAS108. Go to Solution.
You probably need to clarify slightly:
A change relating to switching between one view and another
A change of something within the current view
If it's the former then you have UIApplication.ViewActivatedEvent
if it's the latter then you have ApplicationServices.Application.DocumentChanged (1) used in combination with FilteredElementCollector (2) set to the current view. Then compare the results of Ids in event args from (1) with that of the filter (2).
See the API reference.
https://www.revitapidocs.com/2015/b208aae7-5cbf-21b4-b70e-af2e63ece383.htm
Can't find what you're looking for? Ask the community or share your knowledge.