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

Namespace: [VM](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM)\
Assembly: VM.dll

This class is to represent the Unit.

```csharp theme={null}
public sealed class Unit
```

#### Inheritance

object ←
[Unit](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Unit.md)

#### Extension Methods

[LinkPropertyItemCache.GetLinkProperties(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkProperties_System_Object_VM_Models_Pre_LinkPropertyType_),
[LinkPropertyItemCache.GetLinkPropertiesAndValues(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkPropertiesAndValues_System_Object_VM_Models_Pre_LinkPropertyType_),
[LinkPropertyItemCache.GetLinkedObjects\<T>(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkedObjects__1_System_Object_VM_Models_Pre_LinkPropertyType_)

## Constructors

### Unit()

Initializes a new instance of the [Unit](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Unit.md) class

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

### Unit(Unit)

Initializes a new instance of the [Unit](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Unit.md) class

```csharp theme={null}
public Unit(Unit unitValue)
```

#### Parameters

`unitValue` [Unit](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Unit.md)

The unit

### Unit(UnitType)

Initializes a new instance of the [Unit](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Unit.md) class

```csharp theme={null}
public Unit(UnitType type)
```

#### Parameters

`type` [UnitType](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.UnitType.md)

The type of unit

### Unit(SerializationInfo, StreamingContext)

Initializes a new instance of the [Unit](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Unit.md) class

```csharp theme={null}
public Unit(SerializationInfo information, StreamingContext context)
```

#### Parameters

`information` SerializationInfo

The info.

`context` StreamingContext

The context

## Properties

### Angle

Gets or sets the angle.

```csharp theme={null}
public string Angle { get; set; }
```

#### Property Value

string

### Force

Gets or sets the force.

```csharp theme={null}
public string Force { get; set; }
```

#### Property Value

string

### Handle

Gets the handle.

```csharp theme={null}
public IntPtr Handle { get; }
```

#### Property Value

IntPtr

### Length

Gets or sets the length.

```csharp theme={null}
public string Length { get; set; }
```

#### Property Value

string

### Mass

Gets or sets the mass.

```csharp theme={null}
public string Mass { get; set; }
```

#### Property Value

string

### Power

Gets or sets the power

```csharp theme={null}
public string Power { get; set; }
```

#### Property Value

string

### Temperature

Gets or sets the temperature

```csharp theme={null}
public string Temperature { get; set; }
```

#### Property Value

string

### Time

Gets or sets the time.

```csharp theme={null}
public string Time { get; set; }
```

#### Property Value

string

### Work

Gets or sets the work

```csharp theme={null}
public string Work { get; set; }
```

#### Property Value

string

### this\[string]

Gets or sets the unit by indexer.

```csharp theme={null}
public string this[string type] { get; set; }
```

#### Property Value

string

## Methods

### ConvertTo(Unit, string)

Convert to.

```csharp theme={null}
public double ConvertTo(Unit referenceUnit, string stringType)
```

#### Parameters

`referenceUnit` [Unit](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Unit.md)

The reference unit

`stringType` string

The type

#### Returns

double

The convert data

### Dispose()

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

### Equals(object)

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

#### Parameters

`obj` object

#### Returns

bool

### GetFactor(string)

Get factor for unit type

```csharp theme={null}
public double GetFactor(string type)
```

#### Parameters

`type` string

The unit type

#### Returns

double

The factor

### GetHashCode()

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

#### Returns

int

### Initialize(string)

Initializes a instance.

```csharp theme={null}
public static void Initialize(string stringUnitPath)
```

#### Parameters

`stringUnitPath` string

The path of unit.

### IsContain(string)

Contains unit.

```csharp theme={null}
public bool IsContain(string stringType)
```

#### Parameters

`stringType` string

The type of unit.

#### Returns

bool

true if contains unit type, otherwise false.

## Operators

### operator ==(Unit, Unit)

Compare two units

```csharp theme={null}
public static bool operator ==(Unit left, Unit right)
```

#### Parameters

`left` [Unit](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Unit.md)

The unit

`right` [Unit](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Unit.md)

The unit to compare

#### Returns

bool

true if two units are equal, otherwise false.

### operator !=(Unit, Unit)

Compare two units

```csharp theme={null}
public static bool operator !=(Unit left, Unit right)
```

#### Parameters

`left` [Unit](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Unit.md)

The unit

`right` [Unit](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Unit.md)

The unit to compare

#### Returns

bool

true if two units are not equal, otherwise false.
