Contains Method


Checks if given reference identifies part of object identified by this reference.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since: 2018

Syntax

C#
public bool Contains(
	Reference reference
)
Visual Basic
Public Function Contains ( _
	reference As Reference _
) As Boolean
Visual C++
public:
bool Contains(
	Reference^ reference
)

Parameters

reference
Type: Autodesk.Revit.DBReference
Another reference.

Return Value

Returns true if given reference identifies part of object identified by this reference, false otherwise.

Remarks

Can be used to check:
  • If given Reference is a part of a particular Subelement identified by this Reference.
  • If given Reference is a part of a particular Element identified by this Reference.
The input reference can refer to a subelement or a specific geometric item from an element or subelement.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentNullExceptionThrown when argument is a null reference (Nothing in Visual Basic).

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 →