# OpcRelativePathElement Members

> Reference: Defines a reference and browse name to follow.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcRelativePathElement</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

## Constructors

### OpcRelativePathElement

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [OpcRelativePathElement(OpcName)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/members#opcrelativepathelement-opc-uafx-opcname) | Initializes a new instance of the [OpcRelativePathElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/) class following [HierarchicalReferences](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#hierarchicalreferences) using the `name` specified. |
| [OpcRelativePathElement(OpcName, OpcReferenceType)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/members#opcrelativepathelement-opc-uafx-opcname-opc-uafx-opcreferencetype) | Initializes a new instance of the [OpcRelativePathElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/) class following the `referenceType` and `name` specified. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name` is a null reference (Nothing in Visual Basic). |

#### OpcRelativePathElement(OpcName)

Initializes a new instance of the [OpcRelativePathElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/) class following [HierarchicalReferences](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#hierarchicalreferences) using the `name` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcRelativePathElement(OpcName name)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New(name As OpcName)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) value of the [BrowseName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#browsename) attribute to follow. |

#### OpcRelativePathElement(OpcName, OpcReferenceType)

Initializes a new instance of the [OpcRelativePathElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/) class following the `referenceType` and `name` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcRelativePathElement(OpcName name, OpcReferenceType referenceType)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New(name As OpcName, referenceType As OpcReferenceType)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) value of the [BrowseName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#browsename) attribute to follow. |
| `referenceType` | [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) | The [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) to follow. |

## Properties

### Direction

<span class="api-meta">since v2.18</span>

Gets a value indicating in which direction the references shall be followed.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcReferenceDirection Direction { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Direction As OpcReferenceDirection
```

</div>

**Property value**

[OpcReferenceDirection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/)

One of the members defined by the [OpcReferenceDirection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencedirection/) enumeration.

### IncludeSubtypes

<span class="api-meta">since v2.18</span>

Gets a value indicating whether subtypes of the type of reference identified by either [ReferenceTypeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/members#referencetypeid) or [ReferenceTypeName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/members#referencetypename) shall be followed as well.

<div class="api-signature" data-lang="csharp">

```csharp
public bool IncludeSubtypes { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property IncludeSubtypes As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true to follow subtypes of the type of reference identified by either [ReferenceTypeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/members#referencetypeid) or [ReferenceTypeName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/members#referencetypename); otherwise the value false.

### Name

Gets the [BrowseName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#browsename) of the target node to follow.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcName Name { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Name As OpcName
```

</div>

**Property value**

[OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/)

An instance of the [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) class or a null reference (Nothing in Visual Basic) if all targets of the references identified by the [ReferenceTypeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/members#referencetypeid) or [ReferenceTypeName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/members#referencetypename) shall be followed.

### ReferenceType

Gets the according [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) value for the [ReferenceTypeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/members#referencetypeid) to follow.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcReferenceType? ReferenceType { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property ReferenceType As OpcReferenceType?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/)&gt;

One of the members defined by the [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) enumeration or a null reference (Nothing in Visual Basic) if the [ReferenceTypeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/members#referencetypeid) either is a null reference (Nothing in Visual Basic) or refers to a type of reference not represented by the members defined by the [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) enumeration.

### ReferenceTypeId

Gets the identifier of the rference to follow.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcNodeId ReferenceTypeId { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property ReferenceTypeId As OpcNodeId
```

</div>

**Property value**

[OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/)

An instance of the [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) class which identifies the type of reference to follow or a null reference (Nothing in Visual Basic) if all references shall be followed.

### ReferenceTypeName

<span class="api-meta">since v2.18</span>

Gets the [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) used to follow a specific type of reference using its [BrowseName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#browsename) to determine the according [ReferenceTypeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/members#referencetypeid) while following the current element.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcName ReferenceTypeName { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property ReferenceTypeName As OpcName
```

</div>

**Property value**

[OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/)

An instance of the [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) class to resolve the type reference while following the current element or a null reference (Nothing in Visual Basic) if the current element does not define a type of reference to follow (by name).

## Methods

### ToString

<span class="api-meta">override</span>

Returns a string representing the relative path element.

<div class="api-signature" data-lang="csharp">

```csharp
public override string ToString()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Overrides Function ToString() As String
```

</div>

**Returns**

[String](https://learn.microsoft.com/dotnet/api/system.string)

A string formatted using the components of the current [OpcRelativePathElement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrelativepathelement/).

**Overrides**

[ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)
