# User-Defined Fields Dialog

User-Defined Fields (UDFs) allow you to add extra, non-standard, information to any element (node/pipe/graphic object), which can then be accessed via Scripting. The "User-Defined Fields" property is available for each element via the element's Input Editor. You can also specify default UDFs for each element kind via the Component Defaults dialog. The User-Defined Fields dialog has 2 pages: the 'Fields' page contains an Input Editor to edit the property values, which are defined in the '(Definitions)' page. You define fields using the following format: Name=Kind:Value (with optional :fields after 'Value' depending on the Field Kind.) Field Kinds 0 = String 1 = Integer 2 = Float 3 = Boolean 4 = Pick List 5 = Enum List 6 = Unit List For a string (0) field, specify the default value, for example: Name=0:Jane Doe For an integer (1) field, specify the default value, and, optionally, minimum and maximum input values, for example: Age=1:52 Age (>18)=1:52:18:150 For a float (2) field, specify the default value, as well as (optionally) minimum and maximum input values, for example: Height (No Restriction)=2:5.11 Height (5ft-6ft Only)=2:5.11:5.0:6.0 For a boolean (3) field, specify the default value "True" as 1 or "False" as 0: Standard=3:0 For a pick list (4) field, you need to specify a semi-colon delimited list of "quoted" options that can be selected from a drop-down box, as well as the default value to be selected, for example: QA Status=4:1:"0=To Do";"1=In Progress";"2=Closed" In the above, 3 options will be displayed in a drop-down: To Do, In Progress, and Closed, with In Progress (which has a value of 1 associated with) selected by default. For an enum list (5), specify the default value and the id of the enumerated list, for example: Reducer=5:1:18 In the above, 18 refers to the Reducer Type enumerations list, which contains two entries: 0=Concentric and 1=Eccentric. The :1 default value will select Eccentric from the list. For a unit list (6), specify the unit id, followed by the unit group, for example: Height Unit=6:405:9 In the above, "cm", "ft", "in", etc., from the Length unit group (:9), are displayed in a drop-down box, with "ft" (:405) selected from the list. See the "Scripting | Unit Ids" section for a list of the unit groups and their ids. Accessing User-Defined Fields in Scripting The UDFs are mainly provided for use in Scripting where a property can be accessed with the "UDF." syntax: Element.Property['UDF.FieldName'] or Network.GetProperty(ElementId, 'UDF.FieldName')