How can I create custom fields (attributes), in addition to the default properties seen for each element?
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.
For this technote let’s take the example or 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.
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.
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.
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