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

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →