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: 24.0.0.0 (24.0.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.DBElementId
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

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException This element doesn't have an association defined.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →