I wanted to create a document and activate a specific view such as ’Level 1’. I can use Revit.ApplicationServices.Application.NewProjectDocument method to create my document. However, there is no way to get associated UIDocument object for the document. So UIDocumen.ActiveView property can not be used to set a view to activate it.
However, I found a workaround. You could achieve it by following steps.
1. Close the document created by NewProjectDocument method.
2. Open that file by UIApplication.OpenAndActivateDocument method.
3. Set the view you want to active to ActiveView property of the UI document obtained at the step 2.