Skip to content

Modify Attribute

By this action on dialog Modify Objects the object’s attributes (see Table Object Attributes in the manual „Attributes, Variables, and Keywords) of a single object type or several object types can be changed globally.

When several object types are selected the list box „Attributes” shows the common attributes.

Example 1: Increase present building height by 2 m

This task requires the following steps:

  • Click with the right mouse button on the white area in the CadnaA main window.
  • Select from the context menu the command Modify Objects.
  • On the dialog Modify Objects select the action „Modify Attribute“ and the object „Building“.
  • Keep the option „all“ with „Activation“ and click OK.
  • On the dialog Modify Attribute select the attribute HA from the list of attributes(>>).
  • Select the option "Arithmetic" and enter the following expression: x+2

Dialog Modify Attribute: The attribute HA (object-initial height)is increased for the addressed buildings by 2 m.

Example 2: Change height attribute from absolute to relative

The polygon points of imported roads have absolute heights (with option „Height at every Point“ selected on the dialog Geometry). Instead, relative heights shall be used in order to adapt the road’s geometry to the existing terrain model.

This task requires the following steps:

  • Click with the right mouse button on the white area in the CadnaA main window.
  • Select from the context menu the command Modify Objects.
  • On the dialog Modify Objects select the action „Modify Attribute“ and the object „Road“ and click OK.
  • On the dialog Modify Attribute select the attribute HA (initial height).
  • Select the option "Arithmetic" and enter the value 0 (zero).

Note

A different value may be entered instead. After executing the action, CadnaA adapts the heights of the road’s polygon points to the terrain model, causing the heights at each polygon point of the roads being positioned at the height entered above the terrain model’s height.

  • Confirm all dialog boxes with OK.

After the action has been executed the road heights are at 0 m relative, selecting at the same time the option „Interpolated Height from First/Last Point“. The z-heights of the roads will be adjusted to the terrain model during a subsequent calculation or by displaying a 3D view.

Note

With point objects the attribute H_ATT, with polygon objects the attributes HA_ATT and HE_ATT can be toggled using the available options of different height attributes (r=relative, a=absolute, g=Roof, for polygons, in addition: h=absolute Height at every Point, hg=absolute Height/Ground at every Point).

Example 3: Changing the ground attribute and ground height

At point-like objects (e.g. point sources, receiver points), both the ground height on dialog Geometry, as well as the corresponding ground attribute can be changed using the command Modify Objects, action „Modify Attribute“.

In order to change the ground attribute use the following steps:

  • Click with the right mouse button on the white area in the CadnaA main window.
  • Select from the context menu the command Modify Objects.
  • On the dialog Modify Objects select the action „Modify Attribute“ and e.g. the object „Point Source“ and click OK.
  • On the dialog Modify Attribute select the attribute GROUND_ATT.
  • In order to toggle the attribute to „Input of Value (m)“, select the option „Replace Strings“ and type in:Find what: *Replace with: iThe following settings are available:I = Input of Value (m)H = Use next buildingall the other letters = calculate from DTM (default)

Proceed as follows to change the ground height on dialog Geometry of point-like objects:

  • On dialog Modify Objects select the attribute GROUND (instead of GROUND_ATT) from the list box „Attribute“.
  • In order to set the height to 10 m, select the option „Replace Strings“ and type in:Find what: *Replace with: 10

Example 4: Changing the color of auxiliary polygons

The color of auxiliary polygons can be subsequently changed using the command/action Modify Objects|Modify Attribute.

Note

Deactivate any auxiliary polygons whose color should not be changed.

This task requires the following steps:

  • Click with the right mouse button on the white area in the CadnaA main window and select the command Modify Objects from the context menu.
  • Select the action „Modify Attribute“ just for the active objects of type „Auxiliary Polygon“ and click OK.
  • On the dialog Modify Attribute select the attribute L_COLOR (line color).

Note

The filling of the closed auxiliary polygons can be changed using the attribute F_COLOR.

  • Select the option "Arithmetic" and type in for the „New Value“ RGB(255,0,0).

Note

RGB stands for the color components red/green/blue, wherein the numerical values correspond to the respective color values in this order. In this example, the auxiliary polygons are shown in red.

Use Global Properties on /off

In case the appearance of the auxiliary polygons does not change, this is usually due to the option „Use Global Appearance“ being deactivated (default setting). In this case, CadnaA applies - as with all other types of objects - the color settings etc. from dialog Appearance (Options menu, see Object Appearance in CadnaA Reference Manual).

To change this setting, proceed as follows:

  • Reselect from dialog Modify Objects the action „Modify Attribute“ (e.g. for the active objects only), for the object type „Auxiliary Polygon“ and click OK.
  • Choose from the list box on dialog Modify Attribute the attribute GLOBAL.
  • Select the option „Replace Strings“ and enter a space in the box „Replace with“.

  • After clicking OK, the option „Global“ for all the auxiliary polygons concerned will be deactivated causing the objects to receive the colors defined locally.

Note

In order to set the attribute GLOBAL again, use in box „Replace with“ the character x.

Example 5: Writing a string variable to an attribute

For each object string variables can be entered manually on the dialog Memo-Window (see Dialog Options Name, ID, INFO, ObjectTree, Master). In addition, for various import operations unknown attributes can be imported as string variables (see Unknown Attributes to Memo-Variable in CadnaA Reference Manual). By using the operation described below, the values of string variables can be written to CadnaA attributes.

Note

The operation can be applied to both, numerical and text attributes. In case text strings are copied to numerical CadnaA attributes, however, their value may be set to zero. There is no restriction when copying numerical values to text attributes. Note the restrictions in the case of the attribute ID (see Dialog Options Name, ID, INFO, ObjectTree, Master, ID).

In this example, the value of the string variable HEIGHT from the dialog Memo-Window of terrain contour lines is copied to the attribute HA.

Dialog Memo-Window a contour line:The text variable HEIGHT has a value of 100 m.

This task requires the following steps:

  • Click with the right mouse button on the white area in the CadnaA main window.
  • Select the command Modify Objects from the context menu.
  • On dialog Modify Objects, select the action „Modify Attribute“ for the object type „Contour Line“ and click OK.
  • On the dialog Modify Attribute select the attribute HA (height at first point).
  • Select the option „Replace Strings“ and enter:Find what: *Replace with: {MEMO_HEIGHT}

Note

To ease up the procedure you may select from the list of attributes (>>) the attribute MEMO and then add to the string inside the braces „_HEIGHT“.

Dialog Modify Attribute after having added the partial string „_HEIGHT“

After executing the action by clicking OK, the value of the string variable HEIGHT is copied to the attribute HA of the contour lines.

Example 6: Writing an attribute to a string variable

The adverse operation compared with the previous example is also possible. In this example, the ID of the object „Railway“ shall be written into a string variable named ID_ORIG.

Note

When manipulating attributes of imported objects it can be useful to save the original values of attributes to string variables on the dialog Memo-Window for later use or information purposes.

This task requires the following steps:

  • Click with the right mouse button on the white area in the CadnaA main window.
  • Select the command Modify Objects from the context menu.
  • On dialog Modify Objects, select the action „Modify Attribute“ for the object type „Railway“ and click OK.
  • On the dialog Modify Attribute select the attribute MEMOTXTVAR (addressing a string variable).
  • Enter in the additionally displayed input box „Text Variable“ the name of the text variable to be used: ID_ORIG.
  • Select the option „Replace Strings“ and enter:Find what: *Replace with: {ID}

Note

To ease up the procedure you may select from the list of attributes (>>) the attribute ID directly.

Note

In this case, the option „Arithmetic“ may be used instead („New Value“ = ID, without braces). Consider the restrictions when replacing numerical attributes by strings (see Example 5: Writing a string variable to an attribute).

Example 7: Adding speed limit to road’s name

To the name of roads the speed limit shall be added.

This task requires the following steps:

  • Click with the right mouse button on the white area in the CadnaA main window.
  • Select from the context menu the command Modify Objects.
  • On the dialog Modify Objects select the action „Modify Attribute“ and the object „Road“ and click OK.
  • On the dialog Modify Attribute select the attribute BEZ.
  • Select the option „Replace Strings“ and enter:Find what: *Replace with: \1_vmax={VMAX}

Note

The attribute VMAX may also be selected from the list box (>>).

Clicking OK and confirming with „All“ will execute the operation (see also Changing Column Content in the CadnaA Reference Manual)

Example 8: Modifying Strings

In order to delete or change parts of strings or change the following syntax is available.

Syntax: {name,position_start,position_end,type,decimals}
control keys: braces {}
position_start: starting string position (including)
position_end: ending string position (including)
type: g or u = upper case letters
k or l = lower case letters
t = trim (deletes all preceding and succeeding blanks)
decimals: number of decimals with numeric strings

Note

This operation is not available via the context menu of the object tables.

From the present object ID=abcdef of object „Point Source“ only a part shall remain and be converted to capitals. Proceed as follows:

  • Click with the right mouse button on the white area in the CadnaA main window.
  • Select from the context menu the command Modify Objects.
  • On the dialog Modify Objects select the action „Modify Attribute“ and the object „Point Source“ and click OK.
  • On the dialog Modify Attribute select the attribute ID.
  • Select the option „Replace Strings“ and enter:Find what: *Replace with: {ID,2,4,g,}

After clicking OK, the letters from the 2nd to 4th position of the ID are kept and converted into capitals (new ID=BCD).