Skip to content

Object Attributes per Variant

When projects evolve or grow more complex, there often arises the need to assign different values to an attribute of an object in different variants while keeping most of the remaining object attributes - especially the object geometry - unchanged, e.g.:

  • when the effect of a speed limit of a road is to be evaluated by comparing the two variants -> different value for attribute VPKW in the specific project variants.
  • when the effect of a changed traffic flow is to be evaluated by comparing the forecasted figures to the current ones -> different DTV in the specific project variants.

In general, there are two approaches to achieve different object properties in different project variants:

  • Approach 1: Duplicating the object and editing the attribute(s) of the copy. The activation state (maybe also using the ObjectTree and Groups) defines which object (original or copy) is active and used in which variant.
    • Advantages: Most flexible, works for any CadnaA object type and any attribute
    • Disadvantages: Creating and handling of 2 copies with nearly identical attributes can be cumbersome. Additionally, some special cases with combination of building, building evaluation and the result table are not possible (e.g. having different building reflection properties in different variants while comparing the results of the building evaluation in the result table).
  • Approach 2: Keeping one object, assign different values to it´s attributes for each variant directly.
    • Advantages: easier handling of only one object, easy transfer of attributes between variants using the Copy Attributes feature
    • Disadvantages: Not as flexible, not all CadnaA object types and not all attributes (especially geometry related ones) are available for this approach

This chapter describes in detail approach number 2 for the assignment of inindividual Object Attributes for each variant.

General concept of Object Attributes per Variant

Each object always has one set of attributes called "Master",

  • which is used in any variant if not specified otherwise (using the corresponding checkbox in the object dialog or the attribute VARUSED).
  • where any attribute can be edited - including e.g. Name, ID, Activation, Memo and geometry related attributes.

For each individual variant,

  • it can be specified that the attributes of this variant are independent of “Master” (using the checkbox in the object dialog or the Attribute VARUSED),
  • Variant-individual attribute values can be put in (either directly in the object dialog or e.g. via „modify attribute“) after the variant has been specified as independent of “Master”.

Note

Once a variant was specified as independent of “Master”, changes in “Master” have no effect for this variant. However, the feature “Copy Attributes” may be used to transfer attributes between the different variants.

Note

some attributes are exclusively part of “Master” and can not be changed for the individual variants like e.g. Name, ID, Activation, Memo and geometry related attributes.

Object Dialog and attribute VARUSED

The dropdown menu allows to choose sets of attributes for „Master“ or the individual variants of the project. The checkbox next to the dropdown allows to specify the variant sets as independent of „Master“. A ticked checkbox means independent of „Master“, is equivalent to attribute VARUSED=1 and is indicated with yellow color in the dropdown. An empty checkbox means „as Master“(VARUSED=0).

Colorcoding of attributes in the object dialog

Attribute in yellow: attribute value in this variant differs from the attribute value in „Master“

Attribute in green (if „Master“ is selected): in at least one variant, this attribute has a different value than in „Master“.

Values of attributes and addressing variants explicitely

In general, the variant-specific values of attributes can be addressed explicitly in the format ATTRIBUTE@V#, i.e. by adding @V# to the attribute name, where # is the variant number 1…16 or 0 for master, e.g.:

  • DTV@V0 addresses the „Master“ value of the attribute DTV
  • DTV@V2 addresses the value of variant no. 2 of the attribute DTV

The value of the ATTRIBUTE without explicitly addressing a variant (e.g.just DTV, without @V#)

  • addresses the value for the master (i.e. ATTRIBUTE@V0) if currently selected project variant was not specified as independent of „Master“ (VARUSED@V<current> = 0), or
  • addresses the value for the currently selected project variant (i.e. ATTRIBUTE@V<current>) if the currently selected project variant was specified as independent of „Master“ (VARUSED@V<current> = 1)

The above statements hold for both reading and writing attributes with the exception that writing an attribute (e.g. ATTRIBUTE@V2) for an explicit variant is only possible if this variant is marked as independent of „Master“ (i.e.VARUSED@V2=1 in this example).

Example for attribute values per variant

The following example using a project with 2 variants and DTV as attribute illustrates the possible cases:

Project Variants:
  • V01
  • V02
  • Road object with VARUSED settings:
  • V01 as „Master“, VARUSED@V1=0
  • V02 independent of „Master“, VARUSED@V2=1
  • Attribute Currently selected project variant Reading Writing
    DTV V01 DTV@V0 DTV@V0
    DTV V02 DTV@V2 DTV@V2
    DTV@V0 any DTV@V0 DTV@V0
    DTV@V1 any DTV@V0 -
    DTV@V2 any DTV@V2 DTV@V2

    Copy Attributes

    Copy Attributes is a feature to conveniently transfer single, several or all attributes from one variant to one or several target variants. It is available from the context menu of an object or via Modify objects (if the project has more than one variant). The attributes themselves are documented in the Attributes and Keywords manual.

    Note

    Target variants ("To Variant") must be specified as independent of „Master“ (VARUSED@V<target>=1) to successfully transfer the attributes

    For copying a single attribute, Modify Attributes can also be used. In the following example the DTV-value of variant 2 is copied to „Master“:

    General workflow: first create the objects with a complete and final set of attributes in „Master“. Then specify individual variants as independent of „Master“ and add the variant-specific changes. If an error was found in „Master“, correct it in „Master“ and use „Copy attributes“ to transfer it to the variants which were specified as independent of „Master“.

    How to reset a Variant to „Master“? Set VARUSED to 0 for this variant either by unticking the checkbox in the object dialog or using „Modify Attribute“ (setting VARUSED to 0 if the current variant should be reset to master or VARUSED@V# to 0 for an explicit variant)

    How to import data for specific variants? Generally, upon import objects are created with the „Master“ attribute set. However, with the database import you can add data for specific variants: set VARUSED to 1 for the specific target variant and make sure that the target variant is currently selected project variant while running the database import.