InstanceVoidCutUtilsRemoveInstanceVoidCut Method

Remove a cut applied to the element by a cutting instance with unattached voids.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public static void RemoveInstanceVoidCut(
	Document document,
	Element element,
	Element cuttingInstance
)

Parameters

document  Document
The document containing the two elements
element  Element
The element being cut
cuttingInstance  Element
The cutting family instance
Exceptions
ExceptionCondition
ArgumentException No instance void cut exists between the two elements.
ArgumentNullException A non-optional argument was null
InvalidOperationException Failed to remove the instance cut from the element
Example
// remove all cuts in all family instances created by void-cutting instances
void RemoveVoidCuts(Autodesk.Revit.DB.Document doc, FamilySymbol cuttingSymbol)
{
    FilteredElementCollector collector = new FilteredElementCollector(doc);
    collector.WherePasses(new FamilyInstanceFilter(doc, cuttingSymbol.Id)); // find elements that are family instances of the cutting family

    foreach (FamilyInstance instance in collector)
    {
        foreach (ElementId elementId in InstanceVoidCutUtils.GetElementsBeingCut(instance)) // elements being cut by this instance of the cutting family
        {
            InstanceVoidCutUtils.RemoveInstanceVoidCut(doc, doc.GetElement(elementId), instance); // remove the cut
        }
    }
}
See Also