# S3D2PDS

**S3D2PDS** is an add-on for CAXperts **3D ReportAdapter** used to create **PD_XPDA** backup files containing models and metadata.

<img src="./media/Howto create view styles in S3D_image1.jpg"  width="688" height="218"> 

## Workflow

<table>
<tr><td rowspan=2>

</td><td>

Intergraph **Smart 3D** needs Bentley **MicroStation** to export DGN files (without metadata). **S3D2PDS** triggers **Smart 3D** to export DGN files and adds metadata to the result. The quality of exported graphics will be exactly as good as in the DGN files created manually out of **Smart 3D**.

Intergraph **Smart 3D** requires Bentley **MicroStation** in order to export DGN files without metadata. **S3D2PDS** triggers **Smart 3D** to export the DGN files and then adds metadata to the result. The quality of the exported graphics is exactly the same as that of DGN files created manually from **Smart 3D**.

</td></tr>
<tr><td>

The metadata, that is, the attributes, can be configured by using **3D ReportAdapter** as described in the **3D ReportAdapter** manual. Attributes can be selected from all tasks available in **3D ReportAdapter**.

</td></tr>
</table>

## Prerequisites

To run **S3D2PDS**, a DGN export with specific settings must be performed once in **Smart 3D**. To export a DGN file from **Smart 3D**, the user must:

-   Install 7-Zip, available from <http://www.7-zip.org>

-   Create a filter

-   Copy a delivered View Style to the SymbolShare

-   Copy some delivered Graphic Rules to the SymbolShare

-   Create drawing components

-   Create a drawing volume

For **S3D2PDS**, this must be done only once per plant. All items in the list should be named `3D ReportAdapter`. Afterwards, **S3D2PDS** modifies the filter and triggers drawing generation as required.

First, install the graphic rules supplied with **S3D2PDS** on your system. Simply copy the XML files to the relevant folder. These rules ensure that tasks and aspects are mapped to the correct layers according to the **Layer designations in DGN-Output** table at the end of this document.

## Create a filter

In **Smart 3D**, go to **File** → **Define Workspace**

<img src="./media/Howto create view styles in S3D_image8.png"> 

Select **Filter: Create a New Filter**

<img src="./media/Howto create view styles in S3D_image9.png">

Change the **Name** to **3D ReportAdapter**:

<img src="./media/Howto create view styles in S3D_image10.png">

Select a single subsystem:

<img src="./media/Howto create view styles in S3D_image11.png">

Press **OK**.

Now back in the **Define Workspace** window select **Filter: More...**

<img src="./media/Howto create view styles in S3D_image12.png">

Drag and drop the filter **3D ReportAdapter** from **My Filters** to **Plant Filters** to create a plant filter:

<img src="./media/Howto create view styles in S3D_image13.png"> <img src="./media/Howto create view styles in S3D_image14.png">

Press **Cancel** to close the **Select Filter** window.

Press **Cancel** to close the **Define Workspace** window.

## Copy Graphic Rules and ViewStyle to SymbolShare

Copy the delivered Graphic Rules from 3D ReportAdapter Installation (C:\\Program Files\\CAXperts\\3D ReportAdapter\\Templates) into the appropriate place on SymbolShare:

Graphic Rules:

<img src="./media/Howto create view styles in S3D_image15.png">

WrapperReplacementRules (ControlPoints.xml):

<img src="./media/Howto create view styles in S3D_image16.png">

View Style (3D ReportAdapter.xml):

<img src="./media/Howto create view styles in S3D_image17.png">

The view style and graphic rules must be available for correct generation of the DGN output.

## Create drawing components

Now go to the **Task** → **Space Management**:

<img src="./media/Howto create view styles in S3D_image18.png">

Open the drawing console by using **Tools** → **Drawing Console**:

<img src="./media/Howto create view styles in S3D_image19.png">

Right click the root node and select **New** from the context menu:

<img src="./media/Howto create view styles in S3D_image20.png">

Select Folder and press **OK**:

<img src="./media/Howto create view styles in S3D_image21.png">

Rename the new folder to **3D ReportAdapter**:

<img src="./media/Howto create view styles in S3D_image22.png">

Right click on the 3D ReportAdapter node and select **New** from the
context menu:

<img src="./media/Howto create view styles in S3D_image23.png">

Select Microstation 3D DGN and press **OK**:

<img src="./media/Howto create view styles in S3D_image24.png">

Rename **New 3D DGN Drawings** to **3D ReportAdapter**:

<img src="./media/Howto create view styles in S3D_image25.png">

Setup the 3D ReportAdapter node:

<img src="./media/Howto create view styles in S3D_image26.png">

Select the seed file `mmdlsdz` and the style **3D ReportAdapter** by using **More... / Properties**:

<img src="./media/Howto create view styles in S3D_image27.png">

Press **OK**. Close the **Drawing Console**.

## Create drawing volume

Activate the **Engineering Point** tool (<img src="./media/Howto create view styles in S3D_image28.png">).

Use **Set Target to Origin** (<img src="./media/Howto create view styles in S3D_image29.png">).

Use **Place Drawing Volume by Two Points** (<img src="./media/Howto create view styles in S3D_image30.png">).

Select **Drawing Type** More...:

<img src="./media/Howto create view styles in S3D_image31.png">

Select the 3D ReportAdapter drawing:

<img src="./media/Howto create view styles in S3D_image32.png">

Press **OK**.

Select **Space Folder** More...:

<img src="./media/Howto create view styles in S3D_image33.png">

Select the root node and press **OK**:

<img src="./media/Howto create view styles in S3D_image34.png">

Now enter `-1000000, -1000000, -1000000` as the position of the lower coordinate:

<img src="./media/Howto create view styles in S3D_image35.png">

(Do not forget to lock the values by using the lock symbol.)

Click onto the view.

Now enter `1000000, 1000000, 1000000` as the position of the upper coordinate:

<img src="./media/Howto create view styles in S3D_image36.png">

(Do not forget to lock the values by using the lock symbol.)

Click onto the view.

Now select the **Space** tab on the **Workspace Explorer,** right click the volume and select **Properties** from the context menu.

<img src="./media/Howto create view styles in S3D_image37.png">

Change the name to **3D ReportAdapter** and press **OK**:

<img src="./media/Howto create view styles in S3D_image38.png">

## Test run

Finally, test the drawing creation. Go to **Tools** → **Drawing Console**:

<img src="./media/Howto create view styles in S3D_image39.png">

Right click the 3D ReportAdapter node and select **Create Drawings**:

<img src="./media/Howto create view styles in S3D_image40.png">

Right click the new 3D ReportAdapter node and select **Update Now**:

<img src="./media/Howto create view styles in S3D_image41.png">

Now **Smart 3D** opens **MicroStation** to create a drawing. This may take a few minutes. The result should look like this:

<img src="./media/Howto create view styles in S3D_image42.png">

You can then use **Save As** to save the drawing to disk:

<img src="./media/Howto create view styles in S3D_image43.png">

> It is essential that this test run completes successfully.

Save the DGN file, `3D ReportAdapter.dgn`, to disk and check that the DGN level assignment is correct, see **Layer designations in DGN-Output**. This is a prerequisite for the next steps.

## Change of colours in the dgn-output

The colours in the DGN output can be changed by modifying the graphic rules for the relevant objects that are processed on to a specific level in the DGN.

<img src="./media/Howto create view styles in S3D_image44.png" width="728" height="426"> E.g. if you want to change the colour for Piping-Objects on the simple/detailed physical aspect, you have to open and modify the Graphic Rule in the View Style "3D ReportAdapter":

Open the properties of Graphic Rule "3D ReportAdapter Piping_SP3D":

<img src="./media/Howto create view styles in S3D_image45.png">

Here you can select the colour for the aspect of the respective Object-Type:

<img src="./media/Howto create view styles in S3D_image46.png">

These are SmartSketch colours, but during export to DGN the nearest matching MicroStation colour is selected automatically.

**Important:** You must not change the **Layer for Aspect** of the object type.

## Usage of the software

<img src="./media/Howto create view styles in S3D_image47.png">

After the **S3D2PDS** licence key has been installed, a text box called **PD_XPDA backup output file** is shown in **3D ReportAdapter**. Select the output file name there.

1.  Use the standard **3D ReportAdapter** functions to create the attribute database. For information on how to use **3D ReportAdapter** or install the licence file, see the *3D ReportAdapter Manual*.

2.  Press **Extract Geometry** to create a second database containing the per-part DGN files.

3.  Press **Export to PDS** to create a PD_XPDA backup output file containing both graphics and metadata for the selected part of the model, as specified in **Tasks** and **Filters**. In other words, data can also be extracted only partially to the backup file.

## Command line mode

The **ReportAdapter for SmartPlant® 3D** can be used from the command line to automate export of **SmartPlant 3D** data.

To display the **ReportAdapter** batch-mode help, enter the installation path of **ReportAdapter** followed by `\3D ReportAdapter.exe /?`.

`C:\> "C:\Program Files\CAXperts\3D ReportAdapter\3D ReportAdapter.exe" /?`

\"3D ReportAdapter.exe\" \[/plant plant_name\] \[/config config_file.ini\] \[/output output_file.mdb\] \[/task Piping \[/filter area1\]\] \[/task Piping Catalog \[/filter spec1\] \[/filter spec2\]\] \[/force\]

<table>
<tr><td>

{.Definition}/plant plant_name

</td><td>

SmartPlant 3D plant to process

</td></tr>
<tr><td>

{.Definition}/config config_file.ini

</td><td>

Config file which contains the settings for the extraction. If a configuration file is not defined, the last configuration will be used

</td></tr>
<tr><td>

{.Definition}/output output_file.mdb

</td><td>

Output database. If Output database is not defined, the last configuration will be used

</td></tr>
<tr><td>

{.Definition}/task task_name

</td><td>

Task name to extract, followed by the filter. If no tasks are defined, the last configuration will be used

</td></tr>
<tr><td>

{.Definition}/filter filter_name

</td><td>

Filter name, applied to the previously defined task. Multiple filters can be defined for Piping Catalog task

</td></tr>
<tr><td>

{.Definition}/force

</td><td>

Force extraction

</td></tr>
<tr><td>

{.Definition}/pdxpdafile output.zip

</td><td>

PD_XPDA output file.

</td></tr>
<tr><td>

{.Definition}/execute mode

</td><td>

Use PDS0, PDS1 or PDS2 for mode (the number after PDS specifies the geometry filter setting)

</td></tr>
</table>

Sample batch file to export the whole plant `SP3DTrain`:

**\@ECHO OFF**

**\"C:\\Program Files (x86)\\CAXperts\\3D ReportAdapter\\3D
ReportAdapter.exe\" /plant SP3DTrain /force /pdxpdafile
\"c:\\temp\\s3d2pds.zip\" /execute pds0**

**\"C:\\Program Files\\7-Zip\\7z.exe\" e \"c:\\temp\\s3d2pds.zip\"
-o%1**

**REM Missing: Rescale**

**PAUSE**

## Layer designations in DGN-Output

  **Layer**   **Task**              **Aspect**
  ----------- --------------------- -----------------------------
  1           Piping                Simple/Detailed Physical
  2           Piping                MoldedForms (only for SM3D)
  3           Piping                Insulation
  4           Piping                Operation
  5           Piping                Maintenance
  6           Equipment             Physical
  7           Equipment             MoldedForms (only for SM3D)
  8           Equipment             Insulation
  9           Equipment             Operation
  10          Equipment             Maintenance
  11          Structural            Simple/Detailed Physical
  12          Structural            MoldedForms (only for SM3D)
  13          Structural            Insulation
  14          Structural            Operation
  15          Structural            Maintenance
  16          HVAC                  Simple/Detailed Physical
  17          HVAC                  MoldedForms (only for SM3D)
  18          HVAC                  Insulation
  19          HVAC                  Operation
  20          HVAC                  Maintenance
  21          Electrical            Simple/Detailed Physical
  22          Electrical            MoldedForms (only for SM3D)
  23          Electrical            Insulation
  24          Electrical            Operation
  25          Electrical            Maintenance
  26          ControlPoints         Simple/Detailed Physical
  27          ControlPoints         MoldedForms (only for SM3D)
  28          ControlPoints         Insulation
  29          ControlPoints         Operation
  30          ControlPoints         Maintenance
  31          Space                 Simple/Detailed Physical
  32          Space                 MoldedForms (only for SM3D)
  33          Space                 Insulation
  34          Space                 Operation
  35          Space                 Maintenance
  36          Grids                 Simple/Detailed Physical
  37          Grids                 MoldedForms (only for SM3D)
  38          Grids                 Insulation
  39          Grids                 Operation
  40          Grids                 Maintenance
  41          NoTask                Simple/Detailed Physical
  42          NoTask                MoldedForms (only for SM3D)
  43          NoTask                Insulation
  44          NoTask                Operation
  45          NoTask                Maintenance
  46          Supports              Simple/Detailed Physical
  47          Supports              MoldedForms (only for SM3D)
  48          Supports              Insulation
  49          Supports              Operation
  50          Supports              Maintenance
  51          MoldedForms           Simple/Detailed Physical
  52          MoldedForms           MoldedForms
  53          MoldedForms           Insulation
  54          MoldedForms           Operation
  55          MoldedForms           Maintenance
  56          StructuralDetailing   Simple/Detailed Physical
  57          StructuralDetailing   MoldedForms
  58          StructuralDetailing   Insulation
  59          StructuralDetailing   Operation
  60          StructuralDetailing   Maintenance
  61          NoTask                Simple/Detailed Physical
  62          NoTask                MoldedForms
  63          NoTask                Insulation