I'm trying to build an addin function which can batch open or close views. But I cannot find the API methods in Revit API manual. Anyone knows how to open or close Revit view programmatically?
You can use the UIDocument.ActiveView
property to switch views. This will activate one view and thus close any other.
You can use the Document.Close
method to close the last view of a document.
That should cover most cases.
If you are thinking of doing anything else, think twice, since it is not completely supported by the Revit API, and you might be working against the system, not with it.