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

# ansys::dpf::UnitSystem Struct Reference

`#include <dpf_api_base.h>`

## Public Member Functions

| Type | Name |
| - | - |
| | [UnitSystem](#a87331afc8cfb97200f342280fd49e536) (std::string const \&name, int id) |
| | [UnitSystem](#a588643682966a84ffbed42a60eb5aa93) (std::string const \&name, std::string const \&unit\_names) |
| | [operator std::string](#aed08cd4b0916d79cd83929674fd6a8d5) () const |
| const char \* | [c\_str](#a7e8ff2d5918c48d3a4be9c30beffc8d7) () const |
| [dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#ab4574c9af3f2bb8011da7d1f4c8da20e) | [getId](#a4344c11cdda170ff215ea0e8d9ab40e4) () const |
| std::string | [getUnitNames](#a835847ebc0bbc0566938299f232e0bab) () const |
|  bool | **operator==** ([UnitSystem](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/structansys_1_1dpf_1_1UnitSystem.md) const \&rhs) const |

## Detailed Description

System of measurement units.

## Constructor & Destructor Documentation

### UnitSystem() \[1/2]

```cpp theme={null}
ansys::dpf::UnitSystem::UnitSystem(
    std::string const & name,
    int id
)
```

`explicit`

Create new unit system.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | name | Name of unit system. |
| \[in] | id | Common unit system identifier used by Ansys. |

### UnitSystem() \[2/2]

```cpp theme={null}
ansys::dpf::UnitSystem::UnitSystem(
    std::string const & name,
    std::string const & unit_names
)
```

`explicit`

Creates a new custom unit system from its base unit strings

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | name | Name of unit system |
| \[in] | unit\_names | semicolon-separated list of base units (Length, Mass, Time, Temperature, Electric Charge and Angle) |

## Member Function Documentation

### c\_str()

```cpp theme={null}
const char * ansys::dpf::UnitSystem::c_str() const
```

Gets name of unit system.

**Returns**

Name of unit system.

### getId()

```cpp theme={null}
dp_id ansys::dpf::UnitSystem::getId() const
```

Gets identifer of unit system.

**Returns**

Id of unit system.

### getUnitNames()

```cpp theme={null}
std::string ansys::dpf::UnitSystem::getUnitNames() const
```

Gets unit\_names of unit system (if it is custom).

**Returns**

unit\_names string of unit system (if it is custom).

### operator std::string()

```cpp theme={null}
ansys::dpf::UnitSystem::operator std::string() const
```

Name of unit system.
