Trying to access some Document ElementSet properties (Start View)

I’m trying to use GetStartingViewSettings so I can find out the ViewID and details of the currently selected Starting View (if there is one). I can use Element Type node to actually select the ‘element’ in Revit, but it is relatively useless because I need to address some Members of that object. See attached image.

Is there an easy way to unwrap a given element and directly get data for its members in a Python node?


Try the following script in a Python node with no inputs:

import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import *

import Revit

import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument
OUT = doc.GetElement(StartingViewSettings.GetStartingViewSettings(doc).ViewId)

I’ve just added this to package Clockwork as Document.StartingView …

well done Andreas. seems API doesn’t provide method to set the Starting view…

Works perfectly, thanks!

Hahahah, you beat me to it again. This time difference advantage that you have is almost unfair. :slight_smile: Great job!

Julien, it’s a get/set property. So you could use it to set the starting view as well, like so:

StartingViewSettings.GetStartingViewSettings(doc).ViewId = myNewStartingViewId

(where, obviously, myNewStartingViewId is the ID of the view that you want to set as a starting view…)