# S3D2PDS

## Introduction

**S3D2PDS** is a command-line utility that generates Intergraph SmartPlant Review sessions, `.dgn`, `.drv`, and `.dri` files, from CAXperts **3D ReportAdapter** databases.

### Installation

Requirements:

- Microsoft Windows 7 or later
- Microsoft Excel 2003 or later

### Creation of SmartPlant Review sessions

To generate SmartPlant Review sessions with default settings, S3D2PDS
should be started from the command line like this:

```S3D2PDS.exe --input C:\Path\To\Database\File.db --output C:\Output\Example.dri```

- **-input**: defines the path to the 3D ReportAdapter database
- **-output**: defines the path to the output SmartPlant Review session. S3D2PDS will create `.dgn`, `.drv` and `.dri` files in the same folder.

By default S3D2PDS creates one `.dgn` file per task (e.g. piping,
equipment, ...). If the `.dgn` file exceeds the maximum file size (32 MB)
it gets split automatically.

## Advanced creation of SmartPlant Review sessions

The SmartPlant Review session output can be configured by passing an
Excel configuration file to S3D2PDS. An example can be found at
```Application Folder\Templates\Config.xlsx```.

```S3D2PDS.exe --input C:\Path\To\Database\File.db --output C:\Output\Example.dri --config C:\Path\To\Config.xlsx --dgntemplate C:\Path\To\Seed.dgn```

![](./media/S3D2PDS_image8.png)

The rows contain the following information

<table>
<tr><th>Parameter</th><th>Description</th></tr>
<tr><td>

**Task**

</td><td>

The name of the task to export. Every task has a separate table in the input **3D ReportAdapter** database. This field also accepts the variable `%TaskName%`, which acts as a placeholder for any task.

</td></tr>
<tr><td>

**Attribute Condition**

</td><td>

Contains the filter, SQL `WHERE` condition, that defines which objects should be exported. If the condition is empty, all objects from the task are exported.

</td></tr>
<tr><td>

**Aspect Condition**

</td><td>

Contains the filter, SQL `WHERE` condition, that defines which aspects should be exported. If the condition is empty, all aspects of the specified objects are exported.

</td></tr>
<tr><td>

**DGN_Level**

</td><td>

Defines the MicroStation level, range `1-63`, for the graphics. If it is not defined, the level from the **3D ReportAdapter** aspect settings is used.

</td></tr>
<tr><td>

**Colour**

</td><td>

Defines the colour for the graphics. It can be defined in three different ways:
1.  Hex number, format `#RRGGBB`
2.  DGN colour-table index number, range `0-255`
3.  By setting a specific cell fill colour in Excel
</td></tr>
<tr><td></td><td>

The cell fill colour is ignored if any other method is specified.

</td></tr>
<tr><td>

**Opacity**

</td><td>

This setting is applicable only in CAXperts UDiTH. It is ignored by `S3D2PDS`.

</td></tr>
<tr><td>

**DGN_FileName**

</td><td>

Defines the output file name, without extension. `FileName` can contain fixed text, such as `MyArea`, and or combinations of variables. Any valid attribute from the task table can be used as a variable, for example `%Area System%`. In addition, the special variable `%TopNode%` can be used, which refers to the corresponding `TopNode` of the object in Smart 3D. If the file name is longer than 62 characters, SmartPlant Review cannot open the DGN file.

</td></tr>
</table>

The rules are executed from top to bottom. If an object matches the rule in the first row, the same object is not exported again even if it also matches any rule in the following rows. This ensures that the resulting SmartPlant Review session contains no duplicates.

The optional parameter `dgntemplate` defines the path to the MicroStation seed file used to generate the resulting DGNs. If `dgntemplate` is not defined, the default seed file is used.
