Skip to the page
Tutorial areas

Colour objects by a record value

Colour objects by a number in their data record, such as an install year, from the colour of the lowest value to the highest.

How-toIntermediate5 minMenu: Tools › Records › Modify by Record…

Modify by Record reads a number from a field of the data record on each object, and colours the object to match. This example colours three rectangles by their Install Year, so the oldest is yellow and the newest brown. It needs the Asset Data format with an Install Year field, made in Make a data record format with fields.

Steps

  1. Draw three rectangles side by side with the Rectangle tool.

  2. Choose the Select tool and drag a box round all three. Choose Tools › Records › Attach Record…, pick Asset Data, and click Attach. Each rectangle gets its own record.

  3. Click the first rectangle, open the Data tab in Object Info and the Record: Asset Data heading, and type 2018 in Install Year. Do the same for the middle one with 2022 and the last with 2026.

  4. Drag a box round all three again, so they are all selected, and choose Tools › Records › Modify by Record….

  5. Leave Record Field on Install Year and Operation on Color Gradient. Apply to is Fill Background, and the bounds fill in from the lowest and highest values: Lower bound 2018 and Upper bound 2026. The gradient is Yellow to Brown. Click OK.

    The Modify by Record Value dialog with Install Year, Color Gradient, the bounds 2018 and 2026, and Entire drawing ticked
  6. Each rectangle takes its colour from the gradient: 2018 yellow, 2022 orange-red, 2026 brown. The three are coloured in one undo step.

    Three rectangles filled yellow, orange-red and brown, from left to right

Tips

  • Apply to can be Selected objects only to leave the rest of the drawing as it is.
  • Color Ranges gives each range of values its own colour, and Color Value gives a colour for each value found.
  • Objects with no number in the field are left alone.
  • To change the colours, choose Tools › Records › Modify by Record… again with new settings: the last settings are kept.

Limits

  • It colours the objects once. Change a value later and run Modify by Record… again.