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

# ExportDesigns Class Reference

Part of [Export](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__export)

A struct collecting export information for various design directories.

## Public Member Functions

| Type | Name |
| - | - |
| | [check](#a47c34ec1e578c2ce27cf1c5fcd0d1704) ([Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) [database](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#gaebcac3a2836ec9fdf2e47bd812994b6b)) Checks validity of these data. |
| | [ExportDesigns](#a1d83964912947e55b024670d445ad3cb) ([Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) [database](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#gaebcac3a2836ec9fdf2e47bd812994b6b), [ExportReferenceDesign](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_export_reference_design.md) [reference\_design](#acf3a932aa2f8b555c1a254385c014629)) Initializes defaults and starts a first filesystem scan. ( [Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) ) |
| [TUIntVector](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#ga2a154410171578b305471e89715c7d93) | [getDesignNumbers](#a34c4b23f216aeb33d79984bca8041ea4) () Generates a list of all design sample numbers. |
| string | [getDesignNumbersString](#a91d115ad2f6b884384893cb38c794ea7) () generates the defined design range intervals as a string |
| [DataObjectContainer::string\_vector\_type](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_container.md#ac293ea0e5c280f69a497ea20f20c60b9) | [getDesignPathNames](#abec8ff4bd28cc81e9c577b482291b498) () generates a list of all design directory path names () |
| | [modifyDesigns](#a5d80a037916c72d23fc49fe1f2283bdc) ([Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) [database](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#gaebcac3a2836ec9fdf2e47bd812994b6b)) Exports multiple designs to disk. |
| | [scanDesignRanges](#adc841662c22b0ecc5a2bfe47da762121) ([Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) [database](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#gaebcac3a2836ec9fdf2e47bd812994b6b)) Scans the base path for design directories. ( [Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) ) |
| | [setDesignNumbers](#a2c914c9ef85b4d3a481ed5e3b56da7f1) (string design\_ranges) Sets the design number intervals given as string The method calls [unifyDesignNumbers()](#ad011ce88ed992315a48040de3edbf675); to ensure uniqueness of the defined design numbers. () |
| | [unifyDesignNumbers](#ad011ce88ed992315a48040de3edbf675) () Unifies the design numbers This method ensures that each design number appears at most once in the design interval definition. () |

## Public Attributes

| Type | Name |
| - | - |
| string | [base\_path](#a1be53c8e392d898f99ddc804ff403c84) Base path (absolute path) |
| string | [design\_name\_format](#aa25e23bc102293eb390ebd22691c1a90) Format string for identifying design directories. |
| [TUIntVector](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#ga2a154410171578b305471e89715c7d93) | [ranges\_from](#a845f0717e285151b07a57d047b4dd84e) Defines ranges of the design directories, specifically the left interval boundaries. |
| [TUIntVector](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#ga2a154410171578b305471e89715c7d93) | [ranges\_to](#ac1cd6c172f196f452af5d57b7299b471) Defines ranges of the design directories, specifically the right interval boundaries. |
| [ExportReferenceDesign](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_export_reference_design.md) | [reference\_design](#acf3a932aa2f8b555c1a254385c014629) Stores the information on the reference design/design template (defines which data to be imported) |

## Detailed Description

A struct collecting export information for various design directories.

## Constructor & Destructor Documentation

### ExportDesigns()

```cpp theme={null}
ExportDesigns(
    Structure database,
    ExportReferenceDesign reference_design
)
```

Initializes defaults and starts a first filesystem scan. ( [Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) )

At first, the constructor tries to generate a suiteable base path and design template string:

* Usually, the [ReferenceDesign](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_reference_design.md) object will contain at least one file to be imported. If this is the case, its completed file path will be analyzed using the #DesignPath object. At best, this analysis will return a reliable [base\_path](#a1be53c8e392d898f99ddc804ff403c84) as well as [design\_name\_format](#aa25e23bc102293eb390ebd22691c1a90).
* Otherwise the [ReferenceDesign::base\_path](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_reference_design.md#a1be53c8e392d898f99ddc804ff403c84) of reference\_design given will be separated. Its parent path will be re-used as [base\_path](#a1be53c8e392d898f99ddc804ff403c84) and the other part as [design\_name\_format](#aa25e23bc102293eb390ebd22691c1a90) Afterwards, [ImportDesigns::scanDesignRanges()](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_import_designs.md#a54f34c64e9326398eaaf5cdcb8127e08) will be called automatically and the first design range number re-used as start design ident. Otherise, the design ranges remain empty and the [ImportDesigns::start\_design\_number](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_import_designs.md#a72dfcf1d918d2b4c2eaa79e34becc576) will be initialized to one.

**Parameters**

| Name | Description |
| - | - |
| reference\_design | The reference design object ( [Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) ) |
| database | The database were all data is stored |

## Member Function Documentation

### check()

```cpp theme={null}
check(Structure database)
```

Checks validity of these data.

* If any of the specified directories, design IDs or files does not exist, an exception is thrown
* It also checks the validity of the reference design
* It further checks if any of the objects to be exported does not exist.

**Parameters**

| Name | Description |
| - | - |
| database | The data base where all the data is stored |

### getDesignNumbers()

```cpp theme={null}
TUIntVector getDesignNumbers()
```

Generates a list of all design sample numbers.

**Returns**

A vector of integer numbers where each number represents the design identifier used in the SoS database. The vector indices correspond to the vector of [ImportDesigns::getDesignPathNames](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_import_designs.md#abec8ff4bd28cc81e9c577b482291b498)

### getDesignNumbersString()

```cpp theme={null}
string getDesignNumbersString()
```

generates the defined design range intervals as a string

**Returns**

the design range string, eg. "1-4;6-10;12;15-20"

### getDesignPathNames()

```cpp theme={null}
DataObjectContainer::string_vector_type getDesignPathNames()
```

generates a list of all design directory path names ()

**Returns**

A vector of strings where each string represents the design path name. Each path name is a valid directory name (already includes the base\_path). ()

### modifyDesigns()

```cpp theme={null}
modifyDesigns(Structure database)
```

Exports multiple designs to disk.

This method tries to export as much data as possible and does even proceed in case of errors. Important: the design directories to be exported to must already exist.

**Parameters**

| Name | Description |
| - | - |
| database | The data base where all data is contained. |

### scanDesignRanges()

```cpp theme={null}
scanDesignRanges(Structure database)
```

Scans the base path for design directories. ( [Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) )

Depending on the currently storred information (base path, design name properties, defined files in the reference design) the design directories are determined and the ranges of the indicies are stored in ranges\_from and ranges\_to. Only design directories are accepted which contain ALL of the files being contained in the reference path! ( [Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) ) Furthermore, only those design numbers are accepted for which all objects to be exported exist in the database.

**Parameters**

| Name | Description |
| - | - |
| database | The database where all data are stored |

### setDesignNumbers()

```cpp theme={null}
setDesignNumbers(string design_ranges)
```

Sets the design number intervals given as string The method calls [unifyDesignNumbers()](#ad011ce88ed992315a48040de3edbf675); to ensure uniqueness of the defined design numbers. ()

**Parameters**

| Name | Description |
| - | - |
| design\_ranges | The string to be interpreted, must be of format "1-4;12;15-20;" or "1-4" or "1" or "". |

**Exceptions**

| Name | Description |
| - | - |
| an | exception If the string can not be interpreted. In this case, the definition is not changed. () |

### unifyDesignNumbers()

```cpp theme={null}
unifyDesignNumbers()
```

Unifies the design numbers This method ensures that each design number appears at most once in the design interval definition. ()

()

## Member Data Documentation

### base\_path

```cpp theme={null}
string base_path
```

Base path (absolute path)

### design\_name\_format

```cpp theme={null}
string design_name_format
```

Format string for identifying design directories.

Format strings shall be defined as [Perl Regular Expressions](http://www.boost.org/doc/libs/1_59_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html) including one sub-expression which defines the design ID, eg.

```lua theme={null}
Design_?(\d+)$
```

which matches the string Design, followed by one or no underscore and a sub-expression of one or more digits until the end of the string. The digit group will be used as unique design number within the database. Other examples might be

```lua theme={null}
Design_?(\d\d)$
```

which expects exactly 2 digits, or

```lua theme={null}
first/.*/Design_?(\d{1,5})/dp\d{2}/mech$
```

which matches the directory 'first' relative to *base\_path*, any of its subdirectories, a Design directory consisting of one or 5 digits (zero should be avoided as internal design numbers must be generated in that case), an ANSYS dp subdirectory composed of the dp string followed by exactly 2 digits and as last acceptable subdirectory the string mech. For further common pittfalls - like the maximum sub directory level - refer to DesignScanner::filter ( string )

### ranges\_from

```cpp theme={null}
TUIntVector ranges_from
```

Defines ranges of the design directories, specifically the left interval boundaries.

### ranges\_to

```cpp theme={null}
TUIntVector ranges_to
```

Defines ranges of the design directories, specifically the right interval boundaries.

Must have the same dimensions as #ImportDesings::ranges\_from

### reference\_design

```cpp theme={null}
ExportReferenceDesign reference_design
```

Stores the information on the reference design/design template (defines which data to be imported)
