ViewId Property


Indicates the specific view that will be opened when the model is loaded. InvalidElementId indicates that no view has been specified. In that case, Revit will open the last views that were open at the time the file was saved.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2012

Syntax

C#
public ElementId ViewId { get; set; }
Visual Basic
Public Property ViewId As ElementId
	Get
	Set
Visual C++
public:
property ElementId^ ViewId {
	ElementId^ get ();
	void set (ElementId^ value);
}

Remarks

Note that InvalidElementId will cause Revit to open the same view it would have used in Revit 2011 and prior releases.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException When setting this property: viewId is not an acceptable starting view for this model.
Autodesk.Revit.Exceptions ArgumentNullException When setting this property: A non-optional argument was NULL

See Also