AddReferences Method


Adds the provided list of references to the tag's list of references.

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

Syntax

C#
public void AddReferences(
	IList<Reference> referencesToTag
)
Visual Basic
Public Sub AddReferences ( _
	referencesToTag As IList(Of Reference) _
)
Visual C++
public:
void AddReferences(
	IList<Reference^>^ referencesToTag
)

Parameters

referencesToTag
Type: System.Collections.Generic IList Reference
References to be tagged.

Remarks

The references must pass the following requirements to be added:

  • Must not be already tagged.
  • Must be of the same category when TagMode is TM_ADDBY_CATEGORY.
  • Must be taggable by this tag type.
If any of the above rules is not fulfilled, the execution will be stopped and an exception will be thrown

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The operation failed. Please verify that the references are all taggable and that they are not already tagged.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null
Autodesk.Revit.Exceptions InvalidOperationException This type of tag does not support multiple references.

See Also