How to create custom fields using User Data Extensions

Product(s): WaterGEMS, WaterCAD, StormCAD, SewerCAD, SewerGEMS, CivilStorm, Hammer
Version(s): CONNECT Edition, V8i
Area:

Problem

How can I create custom fields (attributes), in addition to the default properties seen for each element?

Background

Sometimes a need arises to add custom fields, e.g. you want to add notes about existing pipes and new pipes in the water network for identification purpose, which you can color code and visualize any time in the water network. Or you may want to add the date when the pipe was laid or want to put a YES or NO Boolean for certain properties of elements, or pipe condition. For that purpose, text, Boolean, date/time or real data type User Data Extensions (UDX) can be created. Once created, User Data Extensions work in the properties, Flextables and other places just like other default element attributes. For example you can annotate and color code on User Data Extensions.

Note: when adding UDX fields to a Flextable, consider adding them to a Hydraulic Model Flextable (View > Flextables > "Tables - Hydraulic Model"), since the predefined tables (from the Flextable dropdown menu) will be available in all models, whereas your UDX fields may only be available in one particular model. See more here.

User Data Extension Data Types

The following are the available Data Types that you can use when creating a UDX and typical applications:

  • Integer —Any positive ornegative whole number.
  • Text —Any string (text)value up to 255 characters long. Useful for short descriptions/labels.
  • Long Text —Any string (text) up to 65,526 characters long. Useful for lengthy notes.
  • Date/Time —A date + time. The current date appears by default in the format month/day/year. Click the down arrow to change the default date.
  • Boolean —True or False.
  • Enumerated —When you select this datatype, an Ellipses button appears in the Default Value field. Click the Ellipses(...) button to display the Enumeration Editor dialog box, where you can add enumerated members and their associated values. The enumeration "value" is an ID field used for example when performing operations such as a query. (which needs to refer to this ID, not the actual label) To change or add more options, you can edit an existing enumerated UDX and re-open the Enumeration Editor with the "..." button in the "Default Value" field. For more information, see Enumeration Editor Dialog Box. This can be useful for example if you want to identify conduits in a model of a new subdivision by one of the following states: Existing, Proposed, Abandoned, Removed, and Retired.
  • Real —Any fractional decimal number (for example, 3.14). It can also be unitized with the provided options (so that it can appear in the same graph axis as other fields with the same unit type)
  • Real (Formula) —A unitized decimal number whose value is calculated based on a formula. See more here.

How to create a Unitless or Dimensionless formula (ratio) in UDX? 

To develop a unitless formula in a UDX  first, Define the formula using standard mathematical expressions. In order to create a unitless formula, ensure that all units cancel out. This means that any variables with units should appear in a ratio such that the units cancel out. This can be particularly useful for comparing and analyzing different systems that may use different units of measurement, as the unitless formula allows for direct comparison based on a common parameter.

Let’s take an example of the ratio of fluid velocities in the system. Unitless fluid velocity ratio refers to a dimensionless quantity that describes the ratio of fluid velocities in a system, without any units of measurement. The most common example of fluid velocity ratio is the Reynold Number. The Reynolds number is used to predict the occurrence of turbulence in fluid flow and is a fundamental parameter in fluid mechanics. By using unitless fluid velocity ratios, water engineers and practitioners can analyze and design fluid systems without being limited by differences in units or sizes, and can compare and evaluate the performance of different systems.

To set up a unitless formula in UDX please refer to the steps and image attached -

- In <General> change the category to 'Results'.

- Select the 'Storage unit' dropdown and click the 'blank' option, now you can see the unit as 'blank' instead of <None>.

- Set the ‘Numerical formatter’ as a Number.

Note - if the fields are not correctly selected, you may see a Use Notification saying - 'The field named TS_rank_1b for domain element type Pipe has no storage unit or an invalid storage unit assigned.' This notification is based on the example UDX formula created referring to the above image.

Example

For this technote let’s take the example of distinguishing new vs. existing network.

You can create a custom “text” type user data extension for pipes and create prototypes for pipes with the default values of pipe diameter, roughness coefficient and text UDX - NEW PIPE etc.  

So, you can specify the old water network by creating a selection set of that and specify user defined field as 'OLD PIPES' for example or simply 'E' for existing network and then create prototypes for new pipes to be laid out. So, whenever you will lay out any new pipes it will automatically be categorized under new water pipe network.

Solution

To create a text type user data extension, go to Tools > User Data Extensions > Pipe > right click > Add field > Give name to the UDX > Specify data type as Text, as shown below.

Once custom UDX field is created, you can edit that field through pipe properties or pipe flex table to differentiate between new and existing network.

Then, a prototype can be created which will assign this custom field of NEW for new pipes, whenever you lay out any new pipe in the network which will save your time and confusion to differentiate between new and existing pipes.

Also you can then color code the pipe network to distinguish existing and new network visually for reporting purpose as shown below.

A Tip on adding User Data Extensions to Flextables

When adding UDX fields to a Flextable, consider adding them to a Hydraulic Model Flextable (View > Flextables > "Tables - Hydraulic Model"), since the predefined tables (from the Flextable dropdown menu) will be available in all models, whereas your UDX fields may only be available in one particular model. See more here.

Can we share Formula-based UDX?

The answer is 'No'. Forumla-based UDX cannot be shared, since they will reference properties or results that are only available for a given element. The other types can be shared across elements. As for added value, it can help with duplication of effort, if there is some user-defined property that you want to include for multiple elements. This allows a user to create a UDX once and share it, rather than create the same UDX over and over again. UDX is created for certain element types for eg. a text field for a Pipe can be shared for use in other elements. Please note that I will share filed definition only and not the actual value it holds in the UDX.

See Also

Creating Formula-Based User Data Extensions 

How do you create an IF / THEN / ELSE statements using Formula derived user data extensions? 

Changing the default property values for newly created elements

Recommended
Related