Revit 2025 API
Document |
Identifies if the view id is valid as a preview view id.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public bool IsViewIdValidForPreview( ElementId viewId )
Public Function IsViewIdValidForPreview ( viewId As ElementId ) As Boolean
public: bool IsViewIdValidForPreview( ElementId^ viewId )
member IsViewIdValidForPreview : viewId : ElementId -> bool
Parameters
- viewId ElementId
- The view id.
Return Value
BooleanTrue if the view id is valid for preview, false otherwise.

Exception | Condition |
---|---|
ArgumentNullException | A non-optional argument was null |

Only graphical views (3d or 2d) are valid for use as a preview view. Other
views (such as view templates) will not pass this method. InvalidElementId
is accepted by this method as this id means that no special view is set for the
preview.
See Also