> ## 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 UnitsData

Namespace: [OpenTD](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD)\
Assembly: OpenTD.dll

Describes a system of units. Can be inconsistent.

```csharp theme={null}
[MessagePackObject(true)]
public class UnitsData : IEquatable<UnitsData>
```

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ←
[UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md)

## Implements

[IEquatable\<UnitsData>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

## Inherited Members

[object.Equals(object?)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)),
[object.Equals(object?, object?)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)),
[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode),
[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype),
[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone),
[object.ReferenceEquals(object?, object?)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals),
[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Constructors

### UnitsData()

```csharp theme={null}
public UnitsData()
```

### UnitsData(string)

Initializes a new instance of the [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net4-reference/OpenTD.UnitsData.md) class
by parsing the supplied units expression string. Use with basic units
(m, hr, Btu, etc.) or compound units expressions (Btu/hr/ft^2/F, kg/m-s, etc.).
Recognizes strings in the same format output by TD.
Accepted operators : ( ) / - ^
Exponents denoted with optional ^, e.g. m^3 and m3 are both valid
W can be substituted for J/s
1 can be used, as in 1/m^3
Revolution can be used, as in Revolution/s
Case-insensitive
For overlapping model length and orbit length units (m and ft), assumes model length

```csharp theme={null}
public UnitsData(string unitsExpression)
```

#### Parameters

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

### UnitsData(long, long)

Initializes a new instance of the [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net4-reference/OpenTD.UnitsData.md) class, using integers
written to save files or CSR's by SINDA.

```csharp theme={null}
public UnitsData(long TdUnits, long TdUnits2)
```

#### Parameters

`TdUnits` [long](https://learn.microsoft.com/dotnet/api/system.int64)

`TdUnits2` [long](https://learn.microsoft.com/dotnet/api/system.int64)

### UnitsData(UnitsData)

Copy constructor.

```csharp theme={null}
public UnitsData(UnitsData source)
```

#### Parameters

`source` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md)

## Properties

### FlocadOutputUnits

```csharp theme={null}
public UnitsData.FlocadOutputUnitsType FlocadOutputUnits { get; set; }
```

#### Property Value

[UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[FlocadOutputUnitsType](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.FlocadOutputUnitsType.md)

### angle

```csharp theme={null}
public UnitsData.Angle angle { get; set; }
```

#### Property Value

[UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Angle](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Angle.md)

### current

```csharp theme={null}
public UnitsData.Current current { get; set; }
```

#### Property Value

[UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Current](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Current.md)

### def

Use def to create arbitrary combinations of units (advanced).

```csharp theme={null}
public UnitsDefData def { get; set; }
```

#### Property Value

[UnitsDefData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsDefData.md)

### energy

```csharp theme={null}
public UnitsData.Energy energy { get; set; }
```

#### Property Value

[UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Energy](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Energy.md)

### force

```csharp theme={null}
public UnitsData.Force force { get; set; }
```

#### Property Value

[UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Force](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Force.md)

### mass

```csharp theme={null}
public UnitsData.Mass mass { get; set; }
```

#### Property Value

[UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Mass](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Mass.md)

### modelLength

```csharp theme={null}
public UnitsData.ModelLength modelLength { get; set; }
```

#### Property Value

[UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[ModelLength](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.ModelLength.md)

### orbitLength

```csharp theme={null}
public UnitsData.OrbitLength orbitLength { get; set; }
```

#### Property Value

[UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[OrbitLength](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.OrbitLength.md)

### pressure

```csharp theme={null}
public UnitsData.Pressure pressure { get; set; }
```

#### Property Value

[UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Pressure](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Pressure.md)

### temp

```csharp theme={null}
public UnitsData.Temp temp { get; set; }
```

#### Property Value

[UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Temp](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Temp.md)

### time

```csharp theme={null}
public UnitsData.Time time { get; set; }
```

#### Property Value

[UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Time](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Time.md)

### voltage

```csharp theme={null}
public UnitsData.Voltage voltage { get; set; }
```

#### Property Value

[UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Voltage](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Voltage.md)

## Methods

### Equals(UnitsData)

Indicates whether the current object is equal to another object of the same type.

```csharp theme={null}
public bool Equals(UnitsData x)
```

#### Parameters

`x` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md)

#### Returns

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

[true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) if the current object is equal to the `other` parameter; otherwise, [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool).

### Equals(object)

Determines whether the specified object is equal to the current object.

```csharp theme={null}
public override bool Equals(object obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)

The object to compare with the current object.

#### Returns

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

[true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) if the specified object  is equal to the current object; otherwise, [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool).

### GetHashCode()

Serves as the default hash function.

```csharp theme={null}
public override int GetHashCode()
```

#### Returns

[int](https://learn.microsoft.com/dotnet/api/system.int32)

A hash code for the current object.

### GetName(UnitsType)

```csharp theme={null}
public static string GetName(UnitsData.UnitsType type)
```

#### Parameters

`type` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[UnitsType](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.UnitsType.md)

#### Returns

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

### GetTitle(UnitsType)

```csharp theme={null}
public string GetTitle(UnitsData.UnitsType type)
```

#### Parameters

`type` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[UnitsType](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.UnitsType.md)

#### Returns

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

### GetUnitsName(UnitsType)

```csharp theme={null}
public string GetUnitsName(UnitsData.UnitsType type)
```

#### Parameters

`type` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[UnitsType](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.UnitsType.md)

#### Returns

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

### SetFrom(UnitsData)

```csharp theme={null}
public void SetFrom(UnitsData source)
```

#### Parameters

`source` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md)

### SetFromDataset(long, long)

Set this units system based on 64-bit integers written to a save file
or CSR by Sinda.

```csharp theme={null}
public void SetFromDataset(long TdUnits, long TdUnits2)
```

#### Parameters

`TdUnits` [long](https://learn.microsoft.com/dotnet/api/system.int64)

`TdUnits2` [long](https://learn.microsoft.com/dotnet/api/system.int64)

#### Exceptions

[OpenTDException](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.OpenTDException.md)

Problem decoding TdUnits.
or
Problem decoding TdUnits2.

### SetFromUnitsExpression(string)

Sets this UnitsData using the supplied string. Use with basic units
(m, hr, Btu, etc.) or compound units expressions (Btu/hr/ft^2/F, kg/m-s, etc.).
For basic units, SetFromBasicUnit(string str) will be more efficient.
Recognizes strings in the same format output by TD.
Accepted operators : ( ) / - ^
Exponents denoted with optional ^, e.g. m^3 and m3 are both valid
W can be substituted for J/s
1 can be used, as in 1/m^3
Revolution can be used, as in Revolution/s
Case-insensitive
For overlapping model length and orbit length units (m and ft), assumes model length

```csharp theme={null}
public bool SetFromUnitsExpression(string str)
```

#### Parameters

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

#### Returns

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

### SetToEng()

```csharp theme={null}
public void SetToEng()
```

### SetToSI()

```csharp theme={null}
public void SetToSI()
```

### Text(OrbitLength)

```csharp theme={null}
public static string Text(UnitsData.OrbitLength units)
```

#### Parameters

`units` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[OrbitLength](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.OrbitLength.md)

#### Returns

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

### Text(ModelLength)

```csharp theme={null}
public static string Text(UnitsData.ModelLength units)
```

#### Parameters

`units` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[ModelLength](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.ModelLength.md)

#### Returns

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

### Text(Time)

```csharp theme={null}
public static string Text(UnitsData.Time units)
```

#### Parameters

`units` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Time](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Time.md)

#### Returns

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

### Text(Energy)

```csharp theme={null}
public static string Text(UnitsData.Energy units)
```

#### Parameters

`units` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Energy](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Energy.md)

#### Returns

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

### Text(Temp)

```csharp theme={null}
public static string Text(UnitsData.Temp units)
```

#### Parameters

`units` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Temp](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Temp.md)

#### Returns

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

### Text(Mass)

```csharp theme={null}
public static string Text(UnitsData.Mass units)
```

#### Parameters

`units` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Mass](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Mass.md)

#### Returns

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

### Text(Pressure)

```csharp theme={null}
public static string Text(UnitsData.Pressure units)
```

#### Parameters

`units` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Pressure](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Pressure.md)

#### Returns

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

### Text(Angle)

```csharp theme={null}
public static string Text(UnitsData.Angle units)
```

#### Parameters

`units` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Angle](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Angle.md)

#### Returns

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

### Text(Force)

```csharp theme={null}
public static string Text(UnitsData.Force units)
```

#### Parameters

`units` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Force](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Force.md)

#### Returns

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

### Text(Current)

```csharp theme={null}
public static string Text(UnitsData.Current units)
```

#### Parameters

`units` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Current](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Current.md)

#### Returns

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

### Text(Voltage)

```csharp theme={null}
public static string Text(UnitsData.Voltage units)
```

#### Parameters

`units` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Voltage](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Voltage.md)

#### Returns

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

### Text(Resistance)

```csharp theme={null}
public static string Text(UnitsData.Resistance units)
```

#### Parameters

`units` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md).[Resistance](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.Resistance.md)

#### Returns

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

### ToString()

Returns a string that represents the current object.

```csharp theme={null}
public override string ToString()
```

#### Returns

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

A string that represents the current object.

## Operators

### operator ==(UnitsData, UnitsData)

```csharp theme={null}
public static bool operator ==(UnitsData x1, UnitsData x2)
```

#### Parameters

`x1` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md)

`x2` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md)

#### Returns

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

### operator !=(UnitsData, UnitsData)

```csharp theme={null}
public static bool operator !=(UnitsData x1, UnitsData x2)
```

#### Parameters

`x1` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md)

`x2` [UnitsData](https://developer.synopsys.com/docs/thermal-desktop/opentd-reference/net8-reference/OpenTD.UnitsData.md)

#### Returns

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