RVTDocs.com
Namespace: Autodesk.Revit.DB Class: View

View.ConvertToIndependent

Method
Description:
Convert the dependent view to independent.
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.
Syntax
public void ConvertToIndependent()
Examples
public void MakeViewIndependent(View view)
{
    // Independent views will have an InvalidElementId for the Primary View Id
    if (view.GetPrimaryViewId() != ElementId.InvalidElementId)
    {
        view.ConvertToIndependent();
    }
}
Exceptions
Exception Condition
InvalidOperationException This view is not dependent.