Creating a user-defined attribute
1. From the Network menu, choose User-defined attributes.
The List (Attributes) opens and the display is already restricted to user-defined attributes.
Notes: If you select the entry Only user-defined in the selection list, only the user-defined attributes are displayed. If you select All attributes, all attributes of all objects are listed. If you Only network object types, only the attributes of the network object types are listed. |
2. On the toolbar, click the Create button .
The Create user-defined attribute window opens.
3. Select the object type from the Network object list, for which you want to define a user-defined attribute.
4. Confirm with OK.
The Create user-defined attribute (<network object type>) window opens.
5. Make the desired changes.
Element |
Description |
Attribute ID |
Unique attribute name Note An attribute ID must start with a character. Allowed are letters, figures as well as the special characters -, _ and /. |
Code |
Unique code of the attribute |
Name |
Name of the attribute |
Comment |
Description of the attribute (optional) |
Group |
Here you can allocate the attribute to a user-defined group (Managing user-defined groups). |
Data type |
Use the list to select a data type. Select from the following data types: Bool For logical statements, that is true (Yes) or false (No) Note If the Allow empty value option is selected for default values, the Empty option is enabled. File Reference to a file Surface Surface according to your settings (Specifying standard units for length and speed) Integer Whole number Precise duration Precise duration, with decimal places, e.g. 35.004s Speed Speed in kilometers per hour Floating-point number Real number with a fixed number of decimal places (Selecting a decimal point) Length (kilometers/miles) Long length according to setting (Specifying standard units for length and speed) Length (meter/foot) Short length according to setting (Specifying standard units for length and speed) Long text String with an unlimited number of characters in case of an undefined Max. length Alternatively, under Max. length, you can enter a value > 255. Text String with a maximum string length of 255 Currency Number with a fixed number of decimal places, e.g. to display cost attributes (Selecting a decimal point). Time Duration in seconds, display format 12h35min12s Time Time in format hh:mm:ss (12:23:12) or hh:mm (12:23) |
Subattribute type |
From the drop-down list, choose the desired entry:
|
Attribute type | Data attribute
If this option is selected, you can enter the values directly. Formula attribute If this option is selected, the attribute values are generated based on a formula. In most cases, you will select the type Integer. With the functions Text to number and Number to text you can use the types Text and Long text in combination with formulas. Note For the following network objects, which are not always available, you can only create formula attributes:
|
Type-dependent attributes
Depending on the selected Type, you can also specify the following attribute values and options:
Element |
Description |
Default value |
Input field for a default value Note If you do not enter a value for numerical attributes, the empty value is interpreted as 0 in case of arithmetic operations. |
Allow empty value |
If the option is selected, empty values are permitted in case of numerical or boolean data attributes. If the option is not selected, a value must be entered. |
Minimum |
If the option has been selected, you can enter a minimum permitted value. Note If you do not want to define a minimum permitted value, select theUnlimited option. |
Maximum |
If the option has been selected, you can enter a maximum permitted value. Note If you do not want to define a maximum permitted value, select the Unlimited option. |
Decimal places |
Number of decimal places |
Max. length |
Maximum number of characters |
Options for split / connect |
For some types, the following option is provided for the calculation of attribute values when splitting or connecting links. Copy values (default setting)
Scale values
Note You can verify the Values are copied/scaled setting in the Scalable column of the network file. 0 means that the values are copied, 1 means that the values are scaled. |
Cross-section logic |
For attributes of network object types that have a direction (like links or connectors), you need to specify how the cross-section values shall be calculated. The cross-section value is determined on the basis of the values of the two directions. You have the following options:
Depending on the selected option, the total, mean, minimum, or maximum of the two directions will be used as cross-section value. Ignore blocked directions If this option has been selected, blocked directions are ignored in the calculation. |
|
Attribute whose values enter the formula Use the button to select direct or indirect attributes (and subattributes, if provided) of the network object type. The selection is done in a separate window (Selection of attributes). Notes Make sure that your formula does not contain direct or indirect circular references. In the List (Attributes), you can change the formula of a user-defined attribute by clicking the symbol in the Formula column to open the formula editor. |
Click this button to select an operator for the formula. The selection available depends on the operand type, of which the values are used in the formula. Available operators and their priority: The parenthesis operator has the highest priority. Click the symbol to insert it. In the following, the other operator groups are listed in decreasing priority: 1. unary operator:
2. multiplicative binary operators:
3. additive binary operators:
Note You can also use this function to merge two texts.
4. relational binary operators:
5. binary equality operators:
When binary operators have the same priority, the order of evaluation is from left to right (left associative). Example 4/2/2 is evaluated as (4/2)/1 = 2, not as 4/(2/2) = 4 |
|
|
Click the button to select a function for the formula.
Examples MODULO(5,2) = 1 MODULO(9,3) = 0
Examples DIV(5,2) = 2 DIV(9,3) = 3 DIV(7,−3 = −2 DIV(-7,−3 = 2
Example WORDN([TRAINNUMBER],"_",1) extracts from the text string of the attribute "train number" the substring that precedes the separator "underscore".
Note If under User preferences you selected a point as your decimal separator, a comma is used as separator between the elements. Otherwise, a semicolon is used (Selecting a decimal point). |
|
Click the button to open the Insert aggregation function window, in which you can select matrix conversion functions (Fundamentals: Using matrix conversion functions).
|
|
The button opens the Insert TableLookup window. Here, you can insert a function of the type TableLookup in the formula (Fundamentals: Using the TableLookup function). With this function, you can extract a value from any Visum table and edit it in the formula. This is useful, for example, when managing parameter values which are used for the calculation of attributes. Alternatively, you can, for example, transfer data from one network object to another. Network object type From the drop-down list, select the network object type which represents the base of the function. All following conditions of the function refer to the selected network object type. Procedure variables can also be selected. Variable name Enter a variable name which starts with a letter. The first matching value in the table is used for further calculation. If no matching value is found, an empty value is used. |
Click this icon to insert a bracket term without content into the formula. |
- ► Confirm with OK.
The user-defined attribute is inserted. You can edit the values in the list.
Tip: Alternatively, you can add user-defined attributes as follows:
|