This Article presents instructions for user defined labelling and explains how to display a multiline label on the horizontal plan. As an example, we display ground level and invert level for each node in a collection system.
#1 - Creating a user defined column and defining the content
- Open the "Node" editor
- Right-click on the line numbering at the left side of the grid. In the context menu open the context where you can select "Add user defined column"
Fig. 1 - Insert a user defined column
- Give the column a name. Using a prefix such as “exp” avoids confusion with MIKE+ generic fields
- Choose “Show expression column”. This doesn’t create a proper field in the database, but creates sort of a virtual column. The benefit is that the content is automatically updated, whenever the base fields are changed or a new element is added to the model
Fig. 2 - Column naming and field type description
- With <Edit…> open the expressions editor and enter the following expression:
"GL = " + ToString ( [GroundLevel] ) + "\n" + "BL = " + ToString ( [InvertLevel] )
Fig. 3 - Edit the Column Expression command
The expression consists of the following parts:
"GL = " and "BL = " are plain text, which will be displayed on the map.
The individual strings are connected with a + sign. You find the + sign in the "Operator" dropdown menu.
ToString() is a function which is also located in the "Functions“ dropdown menu. It creates a text value from a numerical value.
[GroundLevel] and [Invertlevel] are two fields in the current table msm_Nodes. All fields can be found under the "Variables".
"\n" performs a line break, which is why the label then becomes multiline label.
- Confirm with <OK> and again with <OK>
Fig. 4 - Confirmation of column definition settings
- The new field is added to the very right of the table grid. The line break is not visible yet
Fig. 5 - Column content data
#02 – Follow this workaround when editing the expression
You can always right click on the column header, choose <Edit expression>, and modify the expression. While this seems to work fine, and the labelling in the map is changed accordingly, the label expression stored in the database is frozen to the state when you first saved it.
Therefore, you have to use the following workaround:
- Copy and paste your modified expression somewhere
- Delete the column with a right click on the column header
- Recreate the expression column and paste the modified expression
- Confirm with <OK> and <OK>. Now the modified version is the state when you first saved it
#03 - Adding labels to the Map View
- In the “Layers and symbols” panel find the Nodes and single right click on “Default”. That’s the way to open the “Symbology settings”
Fig. 6 - Map symbology customization
- Change to tab “Label”
- Make labels ☑ Visible
- Choose Label field “expLabel” – you’ll find it right at the bottom of the drop-down list
- Never forget to <Apply to map>, otherwise you won’t see the effect of your changes!
Fig. 7 - Symbology settings definition
The labels are placed within their Default position. Play with the parameters to improve visibility. Increase font size, and position Lower Right with slightly less offset.
Fig. 8 - Resulting Map Labels visualization
Have you seen our latest video tutorial "MIKE+ | Multiline labelling presented by Thomas Telegdy, our MIKE+ Product Specialist? In just under 10 minutes, Thomas demonstrates how to add multiline labels to the map view in MIKE+.
Labels on the map view help understanding and editing a model. Multiline labels are a compact way of presenting more than one attribute per element.
FURTHER INFORMATION & USEFUL LINKS
Manuals and User Guides
MIKE+ Model Manager User Guide
MIKE+ Online help: Symbology settings
MIKE+ Online help: User defined columns
MIKE+ CS - Getting started with urban drainage modelling
MIKE+ | Multiline labelling