> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Class Phoenix::ModelCenter::PlugIn::ModelCenterVariableUtils

![][C#]
![][public]

**Definition**: `LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/ModelCenterVariableUtils.cs` (line 17)

Variable utilities.

## Members

* [Find](#classPhoenix_1_1ModelCenter_1_1PlugIn_1_1ModelCenterVariableUtils_1a7a02b9a25293dd7dc4cc055e1de3296c)
* [GetGroups](#classPhoenix_1_1ModelCenter_1_1PlugIn_1_1ModelCenterVariableUtils_1a7baf10442594b87236d312a14cd03625)
* [GetVariables](#classPhoenix_1_1ModelCenter_1_1PlugIn_1_1ModelCenterVariableUtils_1a7deb8c0add1e288d4057570e274df766)
* [ReadFromDHVariable](#classPhoenix_1_1ModelCenter_1_1PlugIn_1_1ModelCenterVariableUtils_1aa8138d976590694d99cbaa8e26c729b2)
* [ReadFromDHVariable](#classPhoenix_1_1ModelCenter_1_1PlugIn_1_1ModelCenterVariableUtils_1a426acc00c79de61099be067624cbf879)
* [ReadFromIVariable](#classPhoenix_1_1ModelCenter_1_1PlugIn_1_1ModelCenterVariableUtils_1a2383fa5f6e3a88479ab56f5a1d89e59d)
* [ReadFromIVariable](#classPhoenix_1_1ModelCenter_1_1PlugIn_1_1ModelCenterVariableUtils_1a5bfbbf71db510f67add0a436afc4e8b1)
* [ReadFromIVariable](#classPhoenix_1_1ModelCenter_1_1PlugIn_1_1ModelCenterVariableUtils_1a048b1dc7e5823dfa35a8885b2638f772)
* [ReadFromIVariable](#classPhoenix_1_1ModelCenter_1_1PlugIn_1_1ModelCenterVariableUtils_1ae124c2b5efdbe7393a1dfa6f87482e68)
* [ReadFromModelCenter](#classPhoenix_1_1ModelCenter_1_1PlugIn_1_1ModelCenterVariableUtils_1afb54389535b0f272155a001282ab0dbc)
* [WriteToDHVariable](#classPhoenix_1_1ModelCenter_1_1PlugIn_1_1ModelCenterVariableUtils_1a7ce2aec0252b1c9f3d49d635ca7d5574)
* [WriteToIVariable](#classPhoenix_1_1ModelCenter_1_1PlugIn_1_1ModelCenterVariableUtils_1a5c43cc9225dc0674804f6c14d411951e)

## Public static functions

### Function ReadFromIVariable

![][public]
![][static]

```csharp theme={null}
static void Phoenix.ModelCenter.PlugIn.ModelCenterVariableUtils.ReadFromIVariable(IVariable ivar, PHXVariable dest)
```

Read a variable from the specified MC variable. Uses the full ModelCenter.IVariable name for the PHXVariable name.

**Parameters**:

* **ivar**: The [ModelCenter](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/2026-r1/modelcenter-plugin-md/namespacePhoenix_1_1ModelCenter.md) variable COM object.
* **dest**: The variable data to write to.

**Parameters**:

* IVariable **ivar**
* PHXVariable **dest**

**Return type**: void

### Function ReadFromDHVariable

![][public]
![][static]

```csharp theme={null}
static void Phoenix.ModelCenter.PlugIn.ModelCenterVariableUtils.ReadFromDHVariable(IDHVariable dhvar, PHXVariable dest)
```

Read a variable from the specified MC variable metadata. Uses the full DHVariable name for the PHXVariable name.

**Parameters**:

* **dhvar**: The [ModelCenter](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/2026-r1/modelcenter-plugin-md/namespacePhoenix_1_1ModelCenter.md) variable COM object.
* **dest**: The variable data to write to.

**Parameters**:

* IDHVariable **dhvar**
* PHXVariable **dest**

**Return type**: void

### Function ReadFromIVariable

![][public]
![][static]

```csharp theme={null}
static void Phoenix.ModelCenter.PlugIn.ModelCenterVariableUtils.ReadFromIVariable(IVariable ivar, PHXVariable dest, bool compVar)
```

Read a variable from the specified MC variable. Uses the full ModelCenter.IVariable name for the PHXVariable name.

**Parameters**:

* **ivar**: The [ModelCenter](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/2026-r1/modelcenter-plugin-md/namespacePhoenix_1_1ModelCenter.md) variable COM object.
* **dest**: The variable data to write to.
* **compVar**: Flag which determines how the variable will be used. If true it is read as a variable to a component, if false as a variable to a model.

**Parameters**:

* IVariable **ivar**
* PHXVariable **dest**
* bool **compVar**

**Return type**: void

### Function ReadFromDHVariable

![][public]
![][static]

```csharp theme={null}
static void Phoenix.ModelCenter.PlugIn.ModelCenterVariableUtils.ReadFromDHVariable(IDHVariable dhvar, PHXVariable dest, bool compVar)
```

Read a variable from the specified MC variable metadata. Uses the full DHVariable name for the PHXVariable name.

**Parameters**:

* **dhvar**: The [ModelCenter](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/2026-r1/modelcenter-plugin-md/namespacePhoenix_1_1ModelCenter.md) variable COM object.
* **dest**: The variable data to write to.
* **compVar**: Flag which determines how the variable will be used. If true it is read as a variable to a component, if false as a variable to a model.

**Parameters**:

* IDHVariable **dhvar**
* PHXVariable **dest**
* bool **compVar**

**Return type**: void

### Function WriteToDHVariable

![][public]
![][static]

```csharp theme={null}
static void Phoenix.ModelCenter.PlugIn.ModelCenterVariableUtils.WriteToDHVariable(PHXVariable source, IDHVariable dhVar)
```

Write PHXVariable info to an IDHVariable.

**Parameters**:

* **source**: The PHXVariable.
* **dhVar**: The IDHVariable.

**Parameters**:

* PHXVariable **source**
* IDHVariable **dhVar**

**Return type**: void

### Function ReadFromIVariable

![][public]
![][static]

```csharp theme={null}
static void Phoenix.ModelCenter.PlugIn.ModelCenterVariableUtils.ReadFromIVariable(string prefix, IVariable ivar, PHXVariable dest)
```

Read a variable from the specified MC variable.

**Parameters**:

* **prefix**: The path to the containing group.
* **ivar**: The [ModelCenter](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/2026-r1/modelcenter-plugin-md/namespacePhoenix_1_1ModelCenter.md) variable COM object.
* **dest**: The variable data to write to.

**Parameters**:

* string **prefix**
* IVariable **ivar**
* PHXVariable **dest**

**Return type**: void

### Function ReadFromIVariable

![][public]
![][static]

```csharp theme={null}
static void Phoenix.ModelCenter.PlugIn.ModelCenterVariableUtils.ReadFromIVariable(string prefix, IVariable ivar, PHXVariable dest, bool compVar)
```

Read a variable from the specified MC variable.

**Parameters**:

* **prefix**: The path to the containing group.
* **ivar**: The [ModelCenter](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/2026-r1/modelcenter-plugin-md/namespacePhoenix_1_1ModelCenter.md) variable COM object.
* **dest**: The variable data to write to.
* **compVar**: Flag which determines how the variable will be used. If true it is read as a variable to a component, if false as a variable to a model.

**Parameters**:

* string **prefix**
* IVariable **ivar**
* PHXVariable **dest**
* bool **compVar**

**Return type**: void

### Function ReadFromModelCenter

![][public]
![][static]

```csharp theme={null}
static void Phoenix.ModelCenter.PlugIn.ModelCenterVariableUtils.ReadFromModelCenter(string name, IModelCenter modelCenter, PHXVariable dest, bool compVar)
```

Read a variable from the specified MC variable. Uses the full ModelCenter.IVariable name for the PHXVariable name.

**Parameters**:

* **name**: The variable's full name.
* **modelCenter**: The instance of [ModelCenter](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/2026-r1/modelcenter-plugin-md/namespacePhoenix_1_1ModelCenter.md) from which to read the variable.
* **dest**: The variable data to write to.
* **compVar**: Flag which determines how the variable will be used. If true it is read as a variable to a component, if false as a variable to a model.

**Parameters**:

* string **name**
* IModelCenter **modelCenter**
* PHXVariable **dest**
* bool **compVar**

**Return type**: void

### Function WriteToIVariable

![][public]
![][static]

```csharp theme={null}
static void Phoenix.ModelCenter.PlugIn.ModelCenterVariableUtils.WriteToIVariable(PHXVariable src, IVariable ivar)
```

Write a variable to the specified MC variable.

**Parameters**:

* **src**: The variable to write from.
* **ivar**: The [ModelCenter](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/2026-r1/modelcenter-plugin-md/namespacePhoenix_1_1ModelCenter.md) COM object.

**Parameters**:

* PHXVariable **src**
* IVariable **ivar**

**Return type**: void

### Function GetGroups

![][public]
![][static]

```csharp theme={null}
static IGroups Phoenix.ModelCenter.PlugIn.ModelCenterVariableUtils.GetGroups(object obj)
```

Gets the groups from the given [ModelCenter](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/2026-r1/modelcenter-plugin-md/namespacePhoenix_1_1ModelCenter.md) object.

**Parameters**:

* **obj**: The object.

**Returns**:

The groups.

**Exceptions**:

* **InvalidOperationException**: If the given object is not a [ModelCenter](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/2026-r1/modelcenter-plugin-md/namespacePhoenix_1_1ModelCenter.md) object containing groups.

**Parameters**:

* object **obj**

**Return type**: IGroups

### Function GetVariables

![][public]
![][static]

```csharp theme={null}
static IVariables Phoenix.ModelCenter.PlugIn.ModelCenterVariableUtils.GetVariables(object obj)
```

Gets the variables from the given [ModelCenter](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/2026-r1/modelcenter-plugin-md/namespacePhoenix_1_1ModelCenter.md) object.

**Parameters**:

* **obj**: The object.

**Returns**:

The variables.

**Exceptions**:

* **InvalidOperationException**: If the given object is not a [ModelCenter](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/2026-r1/modelcenter-plugin-md/namespacePhoenix_1_1ModelCenter.md) object containing groups.

**Parameters**:

* object **obj**

**Return type**: IVariables

### Function Find

![][public]
![][static]

```csharp theme={null}
static object Phoenix.ModelCenter.PlugIn.ModelCenterVariableUtils.Find(object mcObject, string name)
```

Retrieve a variable or group, recursively.

**Parameters**:

* **mcObject**: The component or group to search.
* **name**: The relative name to search for.

**Returns**:

Either the IVariable of IGroup object by that name. Returns null if not found.

**Parameters**:

* object **mcObject**
* string **name**

**Return type**: object

[public]: https://img.shields.io/badge/-public-brightgreen "public"

[package]: https://img.shields.io/badge/-package-blueviolet "package"

[C#]: https://img.shields.io/badge/language-C%23-blue "C#"

[protected]: https://img.shields.io/badge/-protected-yellow "protected"

[private]: https://img.shields.io/badge/-private-red "private"

[static]: https://img.shields.io/badge/-static-lightgrey "static"
