Revit 2025 API
Instance |
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 )
Public Shared Sub RemoveInstanceVoidCut ( document As Document, element As Element, cuttingInstance As Element )
public: static void RemoveInstanceVoidCut( Document^ document, Element^ element, Element^ cuttingInstance )
static member RemoveInstanceVoidCut : document : Document * element : Element * cuttingInstance : Element -> unit
Parameters
| Exception | Condition |
|---|---|
| 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 |
// 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 } } }
' remove all cuts in all family instances created by void-cutting instances Private Sub RemoveVoidCuts(doc As Autodesk.Revit.DB.Document, cuttingSymbol As FamilySymbol) Dim collector As New FilteredElementCollector(doc) collector.WherePasses(New FamilyInstanceFilter(doc, cuttingSymbol.Id)) ' find elements that are family instances of the cutting family For Each instance As FamilyInstance In collector For Each elementId As ElementId In InstanceVoidCutUtils.GetElementsBeingCut(instance) ' elements being cut by this instance of the cutting family ' remove the cut InstanceVoidCutUtils.RemoveInstanceVoidCut(doc, doc.GetElement(elementId), instance) Next Next End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also