Dear Bernie,
This can be solved by RTFM...
Looking at the Revit API help file RevitAPI.chm, there are two separate ActiveView properties listed, on the (DB) Document and the UIDocument classes.
The former has only a getter. The latter offers a setter as well:
UIDocumen.ActiveView Property
The currently active view of the currently active document.
This property is applicable to the currently active document only. Returns null if this document doesn't represent the active document. The active view can only be changed when:
Cheers,
Jeremy
Just a side note: I do not recommend using the Document.ActiveView getter - it is an obsolete property that will likely go away at some point in the future. Please always use the ActiveView property on the UIDocument class like Jeremy suggests.
@arnostlobelIs there any further information on the obsolescence of Document.ActiveView? We have 2021, the property is still part of the API and not marked as deprecated. There is not much API documentation about Document.ActiveView and UIDocument.ActiveView though. Are there any differences?