RemoveAssociation Method


This method will remove the association for the element with the given ElementId.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 23.0.0.0 (23.1.0.0)
Since: 2023

Syntax

C#
public void RemoveAssociation(
	ElementId id
)
Visual Basic
Public Sub RemoveAssociation ( _
	id As ElementId _
)
Visual C++
public:
void RemoveAssociation(
	ElementId^ id
)

Parameters

id
Type: Autodesk.Revit.DB ElementId
Id of the element for which we want to remove the association.

Remarks

If the id does not have any association, an exception is thrown.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException This element doesn't have an association defined.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null

See Also