# Package

Packaging allows you to include or exclude model objects and save the selection in an **.xlsx** or **.json** file. This is useful when exporting different versions of a model for different stakeholders.

<img src="./media/FilesAddPackage.png" width="250" height="">

### Creating and Loading Folders/Packages

<table>
<tr><td rowspan="2"><img src="./media/ButtonAddPackage.png" width="44" height="44"><img src="./media/image82.jpg" width="44" height="44"><img src="./media/ButtonImportObjects.png" width="44" height="44">

</td><td>

Load or create a new folder or package by clicking the relevant icon. You then gain access to the **Definition** area, where you can add definitions and connect them using logical operators.

</td></tr>
<tr><td>

If a folder or package already exists before you load another one, you can either **replace** the existing folders or packages or **expand** them.

</td></tr>
</table>

> If you try to load a package that does not contain any conditions, loading is cancelled and an error message is shown. If you accidentally saved a folder that contains empty packages, open the `.xlsx` or `.json` file and delete the empty package manually.

<img src="./media/image86.png" width="550" height="157"> <img src="./media/image87.png" width="150" height="">

### Deleting and Saving Folders/Packages

<table>
<tr><td>

<img src="./media/ButtonDelete.png" width="44" height="44">

</td><td>

Delete a folder or package by selecting it and then clicking the **Delete** icon. You are asked to confirm that you want to delete the folder together with all its contents.

</td></tr>
<tr><td>

<img src="./media/ButtonExportObjects.png" width="44" height="44">

</td><td>

Clicking the **Save** icon always saves the entire folder structure, regardless of what is currently selected. A message appears if there are any empty definition groups.

</td></tr>
</table>

### Organising Folders / Packages

> You can drag folders/packages to the end of the list and into/out of folders.

### Visualisation

> After selecting a package, you can display only its elements or grey out the rest.

## Defining Packages

Start by loading or creating a new package. You then gain access to the "Definition" area, where you can add definitions and connect them using logical operators such as **AND NOT**, **OR**, and **AND**.

<table>
<tr><td Colspan="2">Options

</td></tr>
<tr><th>**Condition by attribute**</th><th>**Condition by volume**</th></tr>
<tr><td>

-Equal

</td><td>

-Includes

</td></tr>
<tr><td>

-Not equal

</td><td>

-Overlaps

</td></tr>
<tr><td>

-Like (wildcards)

</td><td>

-NotOverlaps

</td></tr>
<tr><td>

-Not like (wildcards)

</td><td>

-NotIncludes

</td></tr>
</table>

After selecting a package, you have access to the tools for defining conditions:

### Condition by Volume

You can choose which area defined by the volume you want to include by clicking the downward arrow for the selected condition:

#### Includes / NotIncludes

<table>
<tr><td>

<img src="./media/image88.jpg" width="44" height="44">

</td><td>

Define a volume in the same way as for volume clipping. All objects that are completely inside, or respectively outside, this volume become part of the package.

</td></tr>
</table>

#### Overlaps/NotOverlaps

Define a volume in the same way as for volume clipping. All objects that are, or are not, at least partly inside this volume become part of the package.

### Condition by Attribute

<table>
<tr><td>

<img src="./media/image89.jpg" width="44" height="44">

</td><td>

You can choose an attribute, such as approval status or area, and use a text or number string to define the objects you want to include together with a matching condition.

</td></tr>
</table>

#### Equal / Not Equal

The attribute exactly matches the string entered in the text box.

Example: `Uid = c0fc06552004` selects exactly that object with exactly that unique ID.

#### Like / Not Like

The attribute matches the string entered in the text box, including any wildcards.

-  **?** for exactly one or zero character.

-  **_** for exactly one character.

-  **\*** for any number of characters.

> **Example**: `Uid c0fc06552?` matches all objects with the unique ID `c0fc065520` to `c0fc065529` and `c0fc06552a` to `c0fc06552z`, including all valid characters.

**Using wildcards**: If you use **Equal** or **Not equal**, the characters `?` and `*` are treated literally. If you use **Like** or **Not like**, `?` stands for exactly one character and `*` stands for any number of characters. Wildcards can only be added at the beginning or end of search strings.

### Grouping Conditions

It is possible to group conditions and nest them inside one another.

<table>
<tr><td>

<img src="./media/ButtonIntelliClipping.png" width="44" height="44">

</td><td>

With an IntelliGroup, you must choose a radius. All objects that are at least partly inside that radius are included in the package. A radius of `0` means that the objects are touching an object in that group.

</td></tr>
</table>

### Example

<img src="./media/image90.png" width="531" height="392">

You have a model with a restricted area for security reasons. If you need to share the model with contractors while keeping that area hidden, you can do so by placing the restricted section in a package. This requires rules based on attributes and volumes.

<table>
<tr><th Colspan="2">If you want to exclude the selected parts of your model, you can do this by the following steps:</th></tr>
<tr><td>

<img src="./media/ButtonAddPackage.png" width="44" height="44">

</td><td>

Create a new package.

</td></tr>
<tr><td>

<img src="./media/image88.jpg" width="44" height="44">

</td><td>

Select all objects you want to exclude. In the definition area, click **Condition by volume**.

</td></tr>
</table>

Choose **Inside**

<table>
<tr><td>

<img src="./media/ButtonShow.png" width="44" height="44">

</td><td>

Clicking the highlight icon shows that the selected volume also contains some small pipes and structural parts that should not be part of the package:

</td></tr>
<tr><td>

<img src="./media/image89.jpg" width="44" height="44">

</td><td>

To exclude the structural parts, create a new condition. This time, choose **Condition by attribute**.

</td></tr>
</table>

<img src="./media/image92.png" width="450" height="">

Because the **FileName** attribute of all objects that are to be excluded contains **Structure**, select **FileName** under **Available attributes** and enter **Structure** in the text box. In this case, you can use either exact (`Structure`) or fuzzy matching.

<img src="./media/PackagesAttributes.png" width="350">

Now choose **AND NOT** as the logical connection so that all objects included by the first condition remain inside the selection, except for the objects defined by the second condition.

To exclude the two nozzles, select them and create a **Condition by volume** using **Includes**.
<img src="./media/PackagesCondition2.png" width="300">

Connect that condition with **AND NOT**:

![](./media/image95.png)

> This is only one of many possible ways to get this result.

<table>
<tr><td>

<img src="./media/ButtonExportObjects.png" width="44" height="44">

</td><td>

The last step is to save your package by clicking on the icon **Save package**. Enter a name and choose a file format.

</td></tr>
</table>

In UDiTH Builder, you can load this as a **package definition file**.
