# ReportAdapter for Smart® 3D

**ReportAdapter for Smart® 3D** is designed to export **Smart 3D** attributes and graphics into a SQLite database containing one table per task. The resulting records are compressed and internally resolved by code lists. All data can be extracted without any knowledge of SP3D-specific report creation. The intended approach is to use **Smart 3D** workspace filters for the creation of discipline-specific reports.

## Prerequisites

-   Supported operating systems:
    -   Microsoft Windows Server 2008, 2012
    -   Microsoft Windows 7 or later

-   Intergraph Smart 3D 2009 SP5 or later

> ReportAdapter for Smart® 3D requires Smart 3D and a Smart 3D (S3D) licence seat on a Smart Licence Server.

## Setting up ReportAdapter for Smart® 3D

### Select plant

Start **ReportAdapter for Smart® 3D** and select your model plant from the **Plant** combo box:

![](./media/ReportAdapterForSmartPlant3D_image5.png)

> Only plants of the current site are displayed.

### Select filter

To select a filter, click the **Filter** combo box and select **More filters...**

![](./media/ReportAdapterForSmartPlant3D_image6.png)

A window opens listing all available filters. Select the required filter and click **OK**.

![](./media/ReportAdapterForSmartPlant3D_image7.png)

### Select output

Use the **Browse...** button to select the location in which the Microsoft Access (`*.mdb`) or SQLite database (`*.db`) is to be created.

![](./media/ReportAdapterForSmartPlant3D_image8.png)

All settings are stored automatically in the configuration file shown under **Tools → Settings**.

## Configure attributes

**ReportAdapter for Smart® 3D** contains a predefined set of attributes that are reported by default. In addition, users can define and configure their own attributes. No database-specific or programming knowledge is required in order to customise the reportable **Smart 3D** attributes. A table is a combination of attribute sets, and columns with identical names are aligned vertically.

![](./media/ReportAdapterForSmartPlant3D_image9.png)

![](./media/ReportAdapterForSmartPlant3D_image10.png)

### Add new table

To add a new table, right-click in the right-hand panel and click **New table**.

### Attribute set

Each table consists of one or more attribute sets. Each attribute set contains the data for a specific top node. The result of one or more attribute sets is grouped together in the table to which they belong in the output database.

### Add new attribute set

To add a new attribute set, right-click a table and click **New attribute set**.

### Add new attribute

![](./media/ReportAdapterForSmartPlant3D_image11.png)

Drag and drop an attribute into the table on the right-hand side. The attribute then appears under the relevant attribute set.

### Edit attribute set properties

To define the properties of a table, right-click the attribute set and select **Properties**.

![](./media/ReportAdapterForSmartPlant3D_image12.png)

![](./media/ReportAdapterForSmartPlant3D_image13.png)

The type selected here defines the main item used for reporting. For example, with `pipe component → run`, if a pipe component is selected, only the runs belonging to that component are listed. If `run` is selected, empty runs are also listed.

Press **OK** to finish the configuration.

+--------------------------------------------------------------------------------------+----------------------------------------------------------------------+
|| The changes will be applied on the next extraction.                  |
|                                                                                      |                                                                      |
|                                                                                      | Smart 3D labels can be used in the same way as direct object attributes. |
+--------------------------------------------------------------------------------------+----------------------------------------------------------------------+

### Extended attribute settings

Right-click a code-listed attribute to open the extended attribute configuration form:

![D:\\01_Projekte\\98_capture\\2014-05-26_174450_cr.jpg](./media/ReportAdapterForSmartPlant3D_image14.jpg)

Code-listed attributes can be extracted as:

-   Numeric values

-   Values decoded by short description

-   Values decoded by long description (default)

![](./media/ReportAdapterForSmartPlant3D_image15.png)

For values with units, the units can be selected:

![](./media/ReportAdapterForSmartPlant3D_image16.png)

+--------------------------------------------------------------------------------------+-----------------------------------------------------------------+
|| The changes will be applied on the next extraction.             |
|                                                                                      |                                                                 |
|                                                                                      | By default, all attributes use the common unit configuration as |
|                                                                                      | defined in **Menu -> Unit settings**. Here you can select a     |
|                                                                                      | custom unit for a specific attribute.                           |
+--------------------------------------------------------------------------------------+-----------------------------------------------------------------+

#### Find

Select **Find...** from the **Edit** menu to search for available attributes:

![](./media/ReportAdapterForSmartPlant3D_image17.png)

Enter the search text in **Find what** and define the task name in **Look in** in order to search for the attribute in the selected task:

<img src="./media/ReportAdapterForSmartPlant3D_image18.png" width="308" height="244">

## Geometry extraction

**ReportAdapter for Smart® 3D** allows geometry to be extracted from **Smart 3D**. This geometry is used by CAXperts **UDiTH** and CAXperts **S3D2PDS**.

Enable the **Extract Geometry** option and select an existing 3D DGN drawing.

![](./media/ReportAdapterForSmartPlant3D_image19.png)

### Prerequisites

1.  Bentley MicroStation J (V7) has to be installed on the Workstation.

2.  Empty 3D DGN drawing has to be created through the Smart 3D Drawing
    Console, e.g. like this:\
    ![](./media/ReportAdapterForSmartPlant3D_image20.png)\
    This 3D DGN drawing is used by **ReportAdapter for Smart® 3D** for geometry extraction. The user needs permission to update this drawing.

3.  Permission to create new filter in the folder ("Plant filters\\3D
    ReportAdapter" by default).

4.  Write permissions on Shared Content (Drawings\\Catalog\\Rules) to
    be able to create new view or style rules.

+--------------------------------------------------------------------------------------+-----------------------------------------------------------------+
|| Technical Hint regarding MicroStation limitation:               |
|                                                                                      |                                                                 |
|                                                                                      | Geometry extraction by using ReportAdapter for Smart® 3D is     |
|                                                                                      | based on Intergraph Smart 3D export to a 3D DGN file and has    |
|                                                                                      | the same limitations: only graphical model data in a range of   |
|                                                                                      | -26843 m to 26843 m in the XYZ direction, for the M/MM DGN      |
|                                                                                      | seed file, and from -88069 ' to 88069 ' in the XYZ direction,   |
|                                                                                      | for the '/' DGN seed file, are exported into MicroStation       |
|                                                                                      | files. Model data outside this range are not exported.          |
+--------------------------------------------------------------------------------------+-----------------------------------------------------------------+

## Extraction

To start extraction of attributes, and geometry if enabled, click **Extract**.

## Additional SQL statements 

### Create additional SQL statements

SQL statements can be used to extend standard output tables with user-defined attributes or to perform other tasks, such as creating additional tables or queries. These statements can be defined by using **Tools → Additional SQL statements**. They are executed automatically after the extraction process has been completed.

The additional SQL statements can be entered in the **Additional SQL statements to be processed after extraction** field. They should follow the format shown in the following examples:

SQL1=ALTER TABLE Equipment ADD COLUMN \[MyAttribute\] VARCHAR(255)

SQL2=UPDATE \[Equipment\] SET \[MyAttribute\] = \'Test\'

![](./media/ReportAdapterForSmartPlant3D_image21.png)

The tables that can be used in the queries are those created during extraction. Additional tables, if required, must be copied before extraction into the `Template.mdb` database, which can be found in the application folder.

### Use query builder

The included query builder can help to create SQL statements. Create a new statement with the **Add** button and add one of the **Available SQL query templates** to it. Clicking **Add query**, or double-clicking a list item, inserts the query at the cursor position or replaces the selected text.

The **Available SQL query templates** look like:

UPDATE \[%TABLE1%\] SET \[%TABLE1%\].\[%COLUMN1%\]=

When the template is used, the `%TABLE1%` and `%COLUMN1%` fields are filled with the table name and column name selected in the corresponding fields.

> The `%TABLE1%` and `%COLUMN1%` fields are filled from the Access database defined for extraction output, which also includes the tables from `Template.mdb`. This means that the fields are filled only after extraction has been performed once.

If the **Show hidden tables** field is checked, all tables in the database can be selected when building the query. If it is not checked, only the tables displayed in **UniversalReporter** are available, while tables created for internal use remain hidden.

### Create new SQL query template

User-defined **SQL query templates** can be created. To add a new template, click **Add** and enter the template name.

![](./media/ReportAdapterForSmartPlant3D_image22.png)

Fill in the text of SQL statement and the Placeholders for **Tables and
columns to be used by query** textboxes by using the %TABLE\"1% and
%COLUMN1% buttons.

User defined templates can be deleted or modified using the **Remove**
or **Edit** buttons.

+--------------------------------------------------------------------------------------+-----------------------------------------------------------------+
|| The SQL text boxes support syntax highlighting.                 |
|                                                                                      |                                                                 |
|                                                                                      | Depending on the output database format, Microsoft Access       |
|                                                                                      | (`*.mdb`) or SQLite (`*.db`), the SQL syntax may differ.       |
+--------------------------------------------------------------------------------------+-----------------------------------------------------------------+

## Settings

All program settings, such as selected tasks and filters, attributes, and units of measure, are stored automatically for each plant in the configuration file, which is located by default in the user profile folder. The location of the configuration file can be changed by using **Tools → Settings**.

### General

![](./media/ReportAdapterForSmartPlant3D_image23.jpg)

**Add manual extract info**: if enabled, shows the following dialogue before extraction, in which the user can provide additional information evaluated by CAXperts **UniversalReporter**.

![](./media/ReportAdapterForSmartPlant3D_image24.png)

**Clean-up style rules and filter before extraction, do not use for parallel extractions:** if geometry extraction is enabled, this option removes all temporary style rules and filters that may have been left from the previous run of the software. Normally, this option must not be used when more than one extraction of **ReportAdapter for Smart® 3D** is being run on the same project at the same time.

**Extract interferences:** if geometry extraction is enabled, this option extracts interference bubbles, graphics, together with their attributes.

**Custom coordinate system:** to report coordinates by using a custom coordinate system, `CS`, instead of the global coordinate system, the default, click **More** and select the required `CS`.

![](./media/ReportAdapterForSmartPlant3D_image25.png)

> The custom coordinate system is applied only to attribute extraction, that is, reporting, and has no effect on extracted geometry.

**Force Exit extraction job:** provides an additional way to ensure that an extraction job is completed by **3D ReportAdapter**. This can be helpful especially when several extraction jobs are scheduled one after another. This option is also available as a command-line parameter. **Force Exit extraction job** uses a `lite` disconnect from S3D. Use this option only if there is a problem with the standard exit from **3D ReportAdapter**.

### Surface style rules

The colour is defined in a standard S3D Surface Rule Style that is preconfigured in the S3D Surface Rule Style settings. Here you can define the MicroStation levels for the different aspects of a particular object type.

Select the rules to apply from the list of available Surface Rule Styles on the left-hand side and press **Add**.

![](./media/ReportAdapterForSmartPlant3D_image26.png)

The rules are executed from top to bottom. If no style rules are defined, standard colours and MicroStation levels are used.

### Drawings

Defines the isometric and composed drawings to be extracted. To exclude drawings with a specific approval status, clear the corresponding **Approval Status** in the list.

![](./media/ReportAdapterForSmartPlant3D_image27.png)

> Only drawings checked in tree with selected approval status will be extracted

### Piping Catalogue

Defines the piping specifications to be extracted.

![](./media/ReportAdapterForSmartPlant3D_image28.png)

### Check objects in filter

3D ReportAdapter can check whether an extracted object is included in selected filters.

![](./media/ReportAdapterForSmartPlant3D_image29.png)

If at least one filter is selected, the software creates an `ObjectsInFilter` table in the resulting database, with the two columns `Object OID` and `Filter Name`. This functionality is useful, for example, when reporting volumes that include the object.

### Load settings from file

To import settings into the plant configuration file, use **File → Load settings from file**.

> The location of the plant configuration file is not affected. Only the content of the file is overwritten.

### Save settings to file

To export settings from the plant configuration file, use **File → Save settings to file**.

> The location of the plant configuration file is not affected.

## Command line mode

The **ReportAdapter for Smart® 3D** can be used from the command line to automate the export of **Smart 3D** data.

To open the **ReportAdapter** batch-mode help, enter the installation path of **ReportAdapter** followed by `\3D ReportAdapter.exe /?`.
```
"C:\Program Files\CAXperts\3D ReportAdapter\3D ReportAdapter.exe" /?
```
Full syntax:
```
"3D ReportAdapter.exe" [?] [-plant:ExamplePlant] [-config:c:\config_file.ini] [-filter:My Filters\Filter1] [-output:output_file.mdb] [-cleanrules] [-drawing:Plant\New 3D DGN Drawings\Drawing-0001] [-extractgeometry] [-permissiongroup: Admin] [-forceattributes] [-forcegeometry] [-forceexit:1] [-log:D:\temp]
```

  ------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------
  -plant plant_name         Smart 3D plant to process
  -config config_file.ini   Configuration file containing the extraction settings. If no configuration file is defined, the last configuration is used
  -filter filter_name       Filter name from the S3D plant. This can be a plant filter or a filter from My Filters. If no filter is defined, the last configuration is used
  -output output_file.mdb   Output database. If no output database is defined, the last configuration is used
  -cleanrules               Cleans leftover temporary S3D2PDS-specific rules. This is optional
  -drawing                  Path to the 3D DGN drawing from the S3D Drawing Console
  -extractgeometry          If this switch is set, S3D2PDS generates a PD_XPDA backup file
  -permissiongroup          Permission group used for extraction
  -forceattributes          If not defined, only changed attributes are extracted
  -forcegeometry            If not defined, only changed geometry is extracted
  -forceexit                Forces the extraction job to exit by using a `lite` disconnect from S3D. Use this option only if there is a problem with the standard exit from 3D ReportAdapter
  -log                      If not defined, the log file is written to the local Temp directory
  ------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------
