Creating a formula that returns valid data can be a complex task. As the following example shows, you can simplify the process by using the Formula Property Definition worksheet to construct the formula with VBScript Code. You then insert sample values into the formula and evaluate the result.
Example of Completed Formula
The space object has a single numeric value for its height, which is adequate for the majority of spaces in a room schedule. However, to get more control over how space heights are displayed for rooms without flat ceilings, you can create a formula that returns a text override, such as “Vaulted” for a cathedral ceiling, or return the actual height. The completed worksheet for such a formula is shown below.

Process Used to Complete Example
Using primarily the default property set definitions in the Style Manager, the following process was completed.
Added SpaceStyles as a new property set definition
- Imported space styles from schedule table styles drawing.
On the Definition tab for the SpaceObjects property set definition
- Added a manual text property definition called HeightOverride.
- Added a formula property definition called HeightDisplayed.

Edited the HeightDisplayed formula property definition on the Formula Property Definition worksheet
- On the first line under Formula, entered strHeightOverride = "".
As you make changes to the formula, you can view a sample result. For example, entering the formula “2+3” displays “5” in the Sample Result pane. This lets you correct a formula that fails to evaluate as expected.
- Under SpaceObjects with the cursor between the double quotes, selected HeightOverride.
When a property definition is first inserted in a formula, its sample value is taken from an object in the current drawing that uses the formula’s property set definition or from a default object.
- With the cursor after the second quotation mark, pressed Enter twice to insert 2 lines.
- From Statements under Insert VBScript code, added If…Then..Else (Block).
When you move the cursor over an item, a tooltip displays the text that appears in the formula when it is inserted.
After you add VBScript code to the formula, red or gray text may be inserted to help construct the formula. Red indicates fields where additional code must be added. To remove a red field, select it, and enter text, insert a property definition, or insert other VBScript code.
Gray fields surrounded by brackets indicate optional fields. Typing anywhere within the gray brackets, or deleting one bracket, will remove the brackets and convert the code from optional to required.
You can save a formula containing red and gray fields for future editing, but a warning dialog box displays because the formula will not be evaluated correctly. You can access online Help for VBScript code in the formula for more information on its proper usage.
- Selected red condition field, and entered strHeightOverride = "".
- Selected red statements field, and entered RESULT = CDbl( ).
- With the cursor between the parentheses, selected Height under SpaceStyles.
- Deleted the ElseIf line and the line below it.
- Selected red “elseStatements” field, and entered RESULT = strHeightOverride.
- Entered Vaulted for sample value of HeightOverride.
Every time a sample value is changed a new sample result displays.
- Entered 108 for sample value of SpaceStyles:Height.
- Selected Length - Long for Format.
Sample values are formatted and inserted into the formula in place of the corresponding property definition names with brackets surrounding them. The entire sample formula is evaluated, and the result displays in the Sample Result pane.

Because this formula contains the word RESULT, it is evaluated as a function instead of an expression, and the value of the formula property is the last value assigned to RESULT. The result of this valid formula is Vaulted.