Archive | June, 2013

RevitForum Blog: Working with Schedules – Relationship between areas

20 Jun

RevitForum Blog: Working with Schedules – Relationship between areas.

In this recent thread on a question was brought op on how to calculate the Ratio between two Area Types. I’ve dealt with this a lot in trying to create a Template for Building Code Calculations, and came up with a solution.

A copy of the sample file used in this post is found here.

The problem with Revit Schedules is that it’s not possible to make calculations based on a Grand Total. Revit will only calculate per row, and this might not be what you’re after. 
An important rule in the Dutch Building Codes, the 55% rule: 55% of the usable area of ​​a building (“gebruiksoppervlak”) must be qualified as suitable for the long-term presence of people (“verblijfsgebied”). This kind of Area is required to meet all kinds of rules that we just ignore. This blog is about the question: how can I calculate the ratio between “gebruiksoppervlak” and “verblijfsgebied”?

Simple Floor Plan with Rooms assigned

To begin, I just modelled a very simple geometry and placed some Rooms. Now it is important to identify the Rooms that actually belong to the type “verblijfsgebied”. As mentioned, the the rules for assigning a Room to the type “verblijfsgebied” are left for another time, so I pick a random room that I want to assign as a “verblijfsgebied”, while the rest is going to be assigned to “gebruiksoppervlak”. The assignment of a room or area to a certain Building Code Type is still fairly easy:
1. Create a Shared Parameter “VO_naam” for the type of Room and / or Area. This is a text parameter. Group the Parameter under Identity Data, make it an Instance Parameter and assign to the appropriate Category, in this case Room (which can also be Areas).
2. Give the various Rooms correct values of the parameter, in this case and GO and VG1.
3. Make a Schedule of room. Add the following fields:
a. Name
b. Area
c. VO_naam

Room Schedule filled with 3 parameters

4. Add a Calculated Value “VO_oppervlak” as an Area Parameter but you leave the formula field temporarily blank, it will later be filled on a later occasion.

Now it gets more complicated: how can a Revit decide whether a room belongs to “verblijfsgebied” (VO) or “gebruiksoppervlak” (GO), and how to calculate the proper Area?

First off, let’s start with defining the type of Room. To define this a Yes/No Parameter can be used: the user manually checks off whether a Room belongs to the VO or the GO. There is also a more automated (but also complicated) way: by using a so-called Key Schedule. The Dutch Building Code has but a limited number of types of rooms. That certain types of rooms have properties and rules assigned to the, and one of them is whether the type of Room belongs to the VO or GO. Since the Key Schedule can also be used for other purposes and calculations, this method is applied here.

  1. Create a Key to Schedule: View Tab> Schedule. Select as a type of Schedule the Room Schedule and select Key Schedule.
  2. Assign a Key Name and an additional parameter: OF_VO (Conversion Factor_VerblijfsOppervlak). This is an Integer.
  3. Press the right mouse button in the Schedule View and choose Add Row. Add as many rows as desired.
  4. After adding the appropriate rows can be filled the different types. Additional Rows may be added at any time during this excersize. Fill OF_VO parameter. In this case, only the Room Type “verblijfsruimte” is part of the VO (value 1) and the rest of the room types are part of the “gebruiksoppervlak” (value 0).









Setup of the Key Schedule

Once this is completed you can return to the Room Schedule and add the Parameters from the Key Schedule to the Fields in the Room Schedule.
Next, select the parameter VO_oppervlak again and press Edit. In the Formula bar add the following formula: Area * OF_VO. Because you have indicated in the Schedule Key that only the Rooms with the Room type “verblijfsruimte” have a conversion factor of 1, the result of this formula will be 0, unless the Room Type ‘verblijfsruimte” is applied.

Room Schedule with automatic calculation of Area types per room

Second: how can we calculate the Ratio between two types of Area? This cannot be done without some trickery. The problem is, that I can format the Schedule in a way that it will only show two rows, one with VO_naam set to GO and one with VO_naam set to VG 1. I can also create a Ratio-parameter which calculates the Ratio between the two. Just add the Parameters Ratio = Area VG / Area GO.
But, there are a few rules to using Schedules for calculations which causes problems:

  1. Revit will calculate a formula for each Room. This DOESN’T change when Itemize Every Instance is unchecked.
  2. In other words: unchecking Itemize Every Instance does NOT change the outcome of any given Calculated Value in the Schedule. It will look this way because Revit can add up the outcome of all Rows that are hidden, but the outcome of each Room is still the same. In this case we want to reference to the Grand Total Area so this causes a erroneous outcome of the formula:
  3. The formula will read Area VG / 0 = (cannot be solved), when the Room is assigned to Room Type “VG”.
  4. The formula will read 0 / Area GO = 0, when the Room is not assigned to Room Type “VG”.

This outcome is shown in the next few figures and was also the problem in the message posted on Revitforum.









Even though the Grand Totals are correct, the calculated Ratio stays 0%

But how can we now calculate the ratio between “verblijfsruimte” en “gebruiksoppervlak”? For starters, go to the Formatting Tab an check the box Calculate Totals for Area and VO_oppervlak. Then go to the Sorting And Grouping Tab, set Sort By VO_naam on and check Grand Totals.

Switch to “Sorting and Grouping”, Sort By “VO_naam” and check Grand Totals.
After this we create an additional Calculated Value. Create a Calculated Value of the type Percentage and divide Area by .This shows the percentage of a single Room to the overall Grand Total Area.

Calculated Value Verdeling VO_GO

After this we create another Calculated Value, “Area_totaal” with the formula: “Area / Verdeling VO_GO”. With this parameter the Grand Total Area of all Rooms is calculated . Crucial in this step is that the Grand Total Area now is a Room Parameter and therefor appears on each Schedule Row. This makes it possible to use this value in further calculations.

The third Calculated Value is “Percentage_VO” and uses the formula “Verdeling VO_GO / Area_totaal”. This parameter calculates the total percentage of Room type “verblijfsruimte”.
Finally a Calculated Value “Percentage_GO” is created with the formula “(Area-Distribution VO_GO) / Area_totaal”.Theoretically, also the formula “100 – Percentage_VO” could be used, but this formula gives a good check if everything is calculated and whether all available Rooms have been assigned to a certain Room Type.

Calculated Value Area_totaal

Calculated Value Percentage_VO

Calculated Value Percentage_GO

It should now only be a matter of setting the proper Schedule Formatting. The columns 

“Name”, “Area”, “Type ruimte”, “OF_VO”, “Verdeling VO_GO” en “Area_totaal“ can be hidden in the Schedule. Click the right mouse button on the column and select Hide Column. Then go to the Sorting And Grouping tab and uncheck “Itemize Every Instance”. Next, in the Format tab, the formatting of the columns “Percentage_VO” and “Percentage_GO” can be adjusted. Set the Units to Percent, 2 decimal places and with the unit symbol %. The end result should look something like shown in the figure below.

Final result

Does this work with multiple types of Rooms? To investigate this I added a new Phase and an extra room. This also gets as Type “verblijfsruimte” but named VG 2. Now the intention is that both the individual percentages and the total Ratio is calculated. The final result below shows that the desired outcome is indeed shown in the Schedule.

Filling Room Type and VO_naam provides with an accurate Schedule

How to Use Formulas in Autodesk Revit: 8 Steps – wikiHow

1 Jun

How to Use Formulas in Autodesk Revit: 8 Steps – wikiHow.

  1. 1

    Learn how to write a formula for exponentiation: use X raised to the power of Y = X ^ Y

  2. 2

    Learn how to write a formula for E raised to an x power

    • E is a mathematical constant that is approximately equal to 2.7. It is an irrational number, but if we truncate it to 20 decimals it would be 2.7182818284590452353.
    • Revit usage = exp(x)
  3. 3

    Learn how to find the circumference and area of a circle with a formula in the program:

    • Usage in Revit = pi()
    • Circumference = pi() * (Radius * 2)
    • Circumference = pi() * Diameter
    • Circle Area = pi() * Radius ^ 2
  4. 4

    Learn how to find Square Roots of any number in this program.

    • Fixed value = sqrt(999)
    • Parameter = sqrt(Width)
    • Formula= sqrt(Width + Height)
  5. 5

    Learn how to solve logarithm problems.

    • The logarithm of a number to a given base is the exponent to which the base must be raised in order to produce that number. For example, the logarithm of 1000 to base 10 is 3, because three factors of 10 must be multiplied to yield a thousand: 10 × 10 × 10 equals 1000
    • Revit usage = log(1000)
  6. 6

    Learn how to force yes/no parameters to be checked or unchecked.

    • Force checked = 1 < 2
    • Force unchecked = 1 > 2
  7. 7

    Learn how to solve conditional statements. Conditional statement uses this structure:

      • IF (<condition>, <result-if-true>, <result-if-false>)
    • Supported Conditional Operators
      • < Less than
      • > Greater than
      • = Equal
      • / Divide
      • AND Both statements are true
      • OR One of the statements is true
      • NOT Statement is false
    • Conditional statements can contain numeric values, numeric parameter names, and Yes/No parameters. Currently, <= and >= are not implemented. To express such a comparison, you can use a logical NOT. For example, a<=b can be entered as NOT(a>b)
    • Simple IF Statement
      • IF (Length < 900, <true>, <false>)
    • Formula That Returns Strings
      • IF (Length < 900, “Opening too narrow”, “Opening OK”)
    • Using logical AND
      • IF ( AND (x = 1 , y = 2), <true>, <false>)
      • Returns <true> if both x=1 and y=2, else <false>
    • Using logical OR
      • IF ( OR ( x = 1 , y = 2 ) , <true>, <false>)
      • Returns <true> if either x=1 or y=2, else <false>
    • Nested IF statements
      • IF ( Length < 500 , 100 , IF ( Length < 750 , 200 , IF ( Length < 1000 , 300 , 400 ) ) )
      • Returns 100 if Length<500, 200 if Length<750, 300 if Length<1000 and 400 if Length>1000
    • IF with Yes/No condition
    • Length > 40
    • Returns checked box (<true>) if Lenght > 40
    • NOT with Yes/No condition
      • not(Viz)
      • Returns checked box (<true>) if Yes/No parameter “Viz” is unchecked, and returns unchecked box (<false>) if Yes/No parameter “Viz” is checked.
    • IF AND OR Returning the greatest of three values
      • Say you have these 3 length parameters, and want a fourth parameter to return the greatest value/length of the 3:
      • Length A
      • Length B
      • Length C
      • Return Length (Returns the greatest of the three length parameters)
      • Return Length = if(and(or(Length A > Length B, Length A = Length B), or(Length A > Length C, Length A = Length C)), Length A, if(and(or(Length B > Length A, Length B = Length A), or(Length B > Length C, Length B = Length C)), Length B, if(and(or(Length C > Length A, Length C = Length A), or(Length C > Length B, Length C = Length B)), Length C, 0 mm)))
      • Another option is to use an extra “Calc” parameter, which is a bit more clumsy but also way easier and more manageable for us mortals.
      • Calc = if(Length A > Length B, Length A, Length B)
      • Return Length = if(Calc > Length C, Calc, Length C)
  8. 8



    Learn how to solve a trigonometry problem in the software.

    • Known: a+b
      • c = sqrt(a ^ 2 + b ^ 2)
      • A = atan(a / b)
      • B = atan(b / a)
    • Known: a+c
      • b = sqrt(c ^ 2 – a ^ 2)
      • A = asin(a / c)
      • B = acos(a / c)
    • Known: b+c
      • a = sqrt(c ^ 2 – b ^ 2)
      • A = acos(b / c)
      • B = asin(b / c)
    • Known: c + A
      • a = c * sin(A)
      • b = c * cos(A)
      • B = 90° – A
    • Known: c + B
      • a = c * cos(B)
      • b = c * sin(B)
      • A = 90° – B
    • Known: a + B
      • b = a * tan(B)
      • c = a / cos(B)
      • A = 90° – B
    • Known: b + A
      • a = b * tan(A)
      • c = b / cos(A)
      • B = 90° – A
    • Known: a + A
      • b = a / tan(A)
      • c = a / sin(A)
      • B = 90° – A
    • Known: b + B
      1. a = b / tan(B)
      2. c = b / sin(B)
      3. A = 90° – B
    Range of Values

    Given the following parameters:

    actual_value: = if (user_value < min_value, min_value, if (user_value > max_value, max_value, user_value))

    Specify a range of valid entries, with the min_value and max_value parameters; then, use the actual value if it is within the range; otherwise, use your minimum or maximum values.

    Credits: Alfredo Medina, who posted this on March 23rd 2011

    Circular Segments.

    Here’s how to calculate the Segment length, the Chord Length, the Angle etc. (Image should speak for itself)