The information in this article applies to:
QUESTION
I would like to use the RoomVolume text macro in my room labels, but it displays several decimal points. How can I make it display fewer decimal places?
ANSWER
By default, many text macros are setup to simply display the raw, unrounded results of the calculation they perform, but you can easily modify the macro to round down to the nearest value of your choosing.
To create a custom macro that is rounded to a specified number of decimal places
- In this example, create a New Plan and draw a basic square structure.
In this example, we have drawn a structure that measures 15' x 15' on the interior.
-
Select CAD> Text> Text Macro Management from the menu.
-
Select the RoomVolume macro in the list on the left and click the Copy button
- In the Edit Text Macro dialog which displays next, rename the macro to roomVolumeRounded and modify the Value field to:
vol = internal_area * (ceiling_elevation - floor_elevation)
vol.round("cu ft",2)
- To break this down, you are creating an object named
vol
and setting it equal to the volume of the room.
- On the next line, you are calling the
round
function with an argument of 2
using cu ft
. This tells the program to round the volume down to two decimal places using cubic feet.
- Click OK and OK again to confirm the changes.
- Navigate to Edit> Default Settings , expand the Floors and Rooms category, select Room Label from the list, then click Edit.
- On the Text panel of the Room Label Defaults dialog that opens:
- Press Enter on the keyboard to drop to the second line in the text box.
- Type
%roomVolumeRounded%
, which is the name of the macro we just created
- Click OK and Done to close the dialogs and confirm the change.
- Next, click inside of the room using the Select Objects tool, then select the Open Object edit tool.
- On the General panel of the Room Specification dialog that displays, change the Room Type to Living or something else from list of room types, then click OK.
The room's label will now display, along with the volume rounded to two decimal places.
You can apply these same concepts to other macros that result in a long string of numbers.