| Revit 2021.1 API | 
| View..::..ConvertToIndependent Method | 
| View Class Example See Also | 
   Convert the dependent view to independent.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Since: 
   2016
 Syntax
Syntax
| C# | 
|---|
| public void ConvertToIndependent() | 
| Visual Basic | 
|---|
| Public Sub ConvertToIndependent | 
| Visual C++ | 
|---|
| public: void ConvertToIndependent() | 
 Remarks
Remarks
   This method can be only applied to a dependent view.
   A dependent view can be created from another view using method View.Duplicate(ViewDuplicateOption.AsDependent).
   Dependent views have a valid primary view element ID that can be obtained via method View.GetPrimaryViewId();
   Independent views have InvalidElementId as their primary view ID.
 Examples
Examples
 CopyC#
CopyC#public void MakeViewIndependent(View view) { // Independent views will have an InvalidElementId for the Primary View Id if (view.GetPrimaryViewId() != ElementId.InvalidElementId) { view.ConvertToIndependent(); } }
 CopyVB.NET
CopyVB.NETPublic Sub MakeViewIndependent(view As View) ' Independent views will have an InvalidElementId for the Primary View Id If view.GetPrimaryViewId() <> ElementId.InvalidElementId Then view.ConvertToIndependent() End If End Sub
 Exceptions
Exceptions
| Exception | Condition | 
|---|---|
| Autodesk.Revit.Exceptions..::..InvalidOperationException | This view is not dependent. |