Object tags

Objects in an OrcaFlex model maintain a set of name/value pairs known as tags. These tags are user-defined and are ignored by the built-in calculation routines. Tags are intended to be used by external functions, post calculation actions, post-processing scripts etc. However, it is entirely up to you to decide if and how to use them.

Editing tags

Each object that supports tags has a tags data page on the object data form where tags can be viewed and edited.

Figure: User interface for editing tag data

The names must be unique because tags are referred to by name. Names are not case-sensitive. The value can be a multi-line string, although it may be more convenient to split multi-line values into separate tags with single line values.

Tags can be exported and imported as YAML files. This is useful if you want to use the same tags with a number of objects, or if you want to copy tags between models. Selected tags can also be copied using the standard CTRL+C and CTRL+V keyboard actions.

Using tags

As stated above, the built-in OrcaFlex calculation code does not refer to tags. It is typically your code which would refer to them. For instance, given the tags above, taken from a PID controller example, the Python code to read the PID constants might look something like this:

k0 = float(obj.tags.k0)
kP = float(obj.tags.kP)
kI = float(obj.tags.kI)
kD = float(obj.tags.kD)

where obj refers to the model object that owns the tags.

Tags can be modified by batch script and in text data files.

Detailed examples demonstrating the use of tags from code can be found in the external function examples.