InstanceVoidCutUtils.RemoveInstanceVoidCut
Description:
Remove a cut applied to the element by a cutting instance with unattached voids.
Remove a cut applied to the element by a cutting instance with unattached voids.
-
documentThe document containing the two elements
-
elementThe element being cut
-
cuttingInstanceThe cutting family instance
// 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
}
}
}
-
No instance void cut exists between the two elements.
-
A non-optional argument was null
-
Failed to remove the instance cut from the element