## Tutorial 1 - Tank with nozzles

This tutorial explains how to build and bulkload a storage tank symbol for **SmartPlant 3D**.

1.  Find out which parameter names you need to parameterise the symbol in **SmartPlant 3D**. Standard names may be found on the **CustomInterfaces** tab of C:\\Program
    Files\\SmartPlant\\3D\\CatalogData\\BulkLoad\\Datafiles\\Equipment.xls.
    You will find these names also on the Attributes tab of **3D SymbolDesigner's** Config.xls. ![](./media/image127.png)

2.  Open **3D SymbolDesigner**.

3.  Open a new symbol project (<img src="./media/2_image19.png" width="16" height="16"> in the **File** menu).

4.  Five parameters are required: *parVesselLength, parVesselDiameter, parSupportLength, parSupportHeight,* and *parSupportThickness*.
    First, select the **Parameters** item in the menu tree. Then press the **Parameter** button (<img src="./media/2_image26.png" width="16" height="16">) five times. This adds five new parameter items to the project tree:
    <img src="./media/image128.png" width="395" height="244">

5.  Rename the parameters: click `Parameter1` in the menu tree, press **F2** if necessary, and enter **parVesselLength**. Repeat this for `Parameter2` to `Parameter5` with **parVesselDiameter**, and so on:
    <img src="./media/image129.png" width="398" height="236">

6.  The table of variants should now look like this:
    <img src="./media/image130.png" width="750" height="69">

    Now enter the default values for the parameters in the table:
    <img src="./media/image131.png" width="750" height="70">

7.  Rename the `Default` variant and define the SmartPlant 3D parameter mappings. Select the `Parameter1` cell and click the right mouse button. In the context menu, select **Set SmartPlant 3D attribute**. Choose the correct attribute from the list, check **Occurrence attribute**, and press **Apply**.

    Add `OA:` in front of the parameter name if the parameter is an occurrence attribute, that is, an attribute that can be modified at runtime in SmartPlant 3D. Repeat this for `Parameter2` to `Parameter5`. **3D SymbolDesigner** checks the spelling.
    <img src="./media/image132.png" width="750" height="288">

8.  The parameters are now valid, and the background colour changes to green:
    <img src="./media/image133.png" width="779" height="52">

9.  Select the Project.Symbol.Parameters node and click twice on the **Add piping port (bolted preset)** toolbar icon (<img src="./media/image48.png" width="16" height="16">) to add two pipe ports and twice on the **Add piping connector** button (<img src="./media/image51.png" width="16" height="16">) to add two nozzles.

10. Click twice on the **Spherical Segment** button (<img src="./media/image134.png" width="16" height="16">), once on the **Cylinder** button (<img src="./media/image135.png" width="16" height="16">) and twice on the **Box** button
    (<img src="./media/image69.png" width="16" height="16">) to add the primitives for the tank geometry. The symbol tree should now look like:\
    <img src="./media/image136.png" width="317" height="324">

11. Uncheck, that is, hide, all primitives except `Cylinder1`, and expand the `Cylinder1` node in the menu tree:
    <img src="./media/image137.png" width="315" height="378">

12. Enter **parVesselLength** into the formula for the cylinder's length (L1).

13. Enter **parVesselDiameter** into D1.

14. Zoom out or in (<img src="./media/image21.png" width="16" height="16"> / <img src="./media/image22.png" width="16" height="16">) until the full cylinder is visible in the view:
    <img src="./media/image23.png" width="756" height="454">

15. Check `SphericalSegment1` and enter **180 deg** or **180°** in the `Rotation.Z` formula:
    The semi-sphere is now visible on the left side of the cylinder:
    <img src="./media/image24.png" width="756" height="454">

16. Enter **parVesselDiameter** into Geometry.D1 and **parVesselDiameter / 4** into Geometry.R1:\
    <img src="./media/image25.png" width="756" height="454">

17. Switch to wireframe mode (<img src="./media/image26.png" width="45" height="16">), then tick the `SphericalSegment2` node. Enter **parVesselDiameter** in `Geometry.D1`, **parVesselDiameter / 4** in `Geometry.R1`, and **parVesselLength** in `Translation.X` of `SphericalSegment2`:
    <img src="./media/image27.png" width="756" height="454">

18. Tick the Box1 and Box2 nodes and enter **parSupportThickness** into Geometry.L1 and **parSupportLength** into Geometry.L3 of both boxes.
    The supports should reach into the tank, so the formula for Geometry.L2 of both boxes is **parVesselDiameter / 4 + parSupportHeight**.

19. The formula for Translation.Z of both boxes is **- 3 \* parVesselDiameter / 8 - parSupportHeight / 2**.

20. Enter **parVesselLength** into Translation.X of Box2 to translate the box.

21. Rotate Box2 by entering **180 deg** into its Rotation Z.

22. Tick PipingConnector1 and PipingConnector2. Rotate PipingConnector1 by entering **180 deg** into its Rotation Z.

23. Enter **- parVesselDiameter / 2** into Translation.X of PipingConnector1.

24. Enter **parVesselLength + parVesselDiameter / 2** into Translation.X of PipingConnector2.

25. Set Geometry.L1 of PipingConnector1 and PipingConnector2 to **parVesselDiameter / 2**.

26. The modelling of the tank symbol is now finished:
    <img src="./media/image28.png" width="756" height="454">
    
27. Press the toolbar button (<img src="./media/image29.png" width="16" height="16">) to export the symbol to SmartPlant 3D.

28. Select the parent node of the new symbol in the catalogue tree view on the first tab. If you see only a node named `Catalogue`, double-click it to open the tree. Then press **Add**:
    <img src="./media/image30.png" width="230" height="118">

29. Select the new node and enter the name in the **Catalogue node** column and the description of the new symbol class in the **Key** column, for example `HorizontalTank`:
    <img src="./media/image31.png" width="600" height="670">

30. Keep this item selected and click on the **Build** tab:\
    <img src="./media/image32.png" width="600" height="389">

31. Click **Browse...** to select a target folder for the Visual Basic project and the bulkload sheet.

32. Uncheck all items on the **Compiler settings** frame.

33. When Visual Basic 6 is installed on your machine: Tick **Compile project.**

34. Click **Start**. Before the export begins, **3D SymbolDesigner** checks whether the parameters and the variant names used are valid, see *0 Naming rules*. This helps to avoid errors during the bulkload process afterwards. Any errors that occur are shown in the **Error list** tab. Clicking an item in the list moves the cursor to the corresponding cell in the table.

35. Optionally: Export of a 3D PDF datasheet (see: *Export of a 3D PDF datasheet*)

36. Press **OK** to close the **SmartPlant 3D Wizard window**. Now you may close the CAXperts **3D SymbolDesigner** program.

37. If Visual Basic or Visual Basic .NET is not available, compile the resulting Visual Basic project on a machine on which Visual Basic is installed and register the DLL on the target system.

38. Save and bulkload the Excel file by using the append mode of the **Bulkload** tool provided with SmartPlant 3D:
    <img src="./media/image83.jpg" width="588" height="715">

39. After the bulkload, the new symbol is available in the SmartPlant 3D catalogue:
    <img src="./media/image34.png" width="750" height="628">

40. After placement, the symbol looks like this:
    <img src="./media/image35.png" width="748" height="550">
