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.

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.

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