BIM Day Out – Revit Formulas

Xrev is currenty attending BIM Day Out in Perth, Australia.  We have 2 speaking spots.  A lab on Revit Formulas and a discussion panel on Revit Manufacturer Content.  The first, from the feedback seemed to very successful.  I was a little concerned considering the complexity of the subject matter and the fact it had to be crammed into less than an hour.

For this session, essentially I had setup a single family containing a number of issues you may face with content creation and how to go about using formulas to make a user friendly solution.  Below is the formulas we generated, for those that have the datasets and were unable to keep up or forgot to save…

  1. Stopping an array breaking
    1. if(Task 1 Length / Task 1 Spacing < 2, 2, Task 1 Length / Task 1 Spacing)
  2. Control the number of  connectors
    1. if(Task 2 Connector,3,2)
  3. Control elements based on Family Type selections
    1. if(Task 3 Type = Task 3 Size 1, “1”, if(Task 3 Type = Task 3 Size 2, “2”, “3”))
  4. Using Trigonometry
    1. Task 4 Offset X * tan(Task 4 Angle)
  5. Visibility that is mutually exclusive
    1. Task 5 Value = 1, Task 5 Value = 2, Task 5 Value = 3
  6. Formulas to display error messages
    1. if(and(Task 6 Length > 1000 mm, Task 6 Error), “Too big”, if(and(Task 6 Length < 500 mm, Task 6 Error), “Too Small”, “”))
    2. or(Task 6 Length > 1000 mm, Task 6 Length < 500 mm)
  7. Controlling a Void cut/uncut
    1. if(Task 7 Cut, 0 mm, 220 mm)

For those with the datasets these will make a lot more sense.

There was also a little trick that I wanted to get to but ran out of time.   It is possible to hide shared parameters from end users by editing the share parameters file.


Hidden Parameters in a shared parameter file

By changing the last integer to 0, you are effectively hiding the parameter from the end user…

Finally, if you need to write lots of nested if statements it can be somewhat tedious.  I have generated an excel file that allows you to specify the values and the conditions and then there is a formula in the cell that can be “filled down” to write the Revit formula for you.  Then all you need to do is copy the bottom formula into your family and your done…  No need to worry about missing a bracket or syntax errors…

Excel Script

Download the Excel file here

Let me know if you find this useful!

This entry was posted in Promotion and tagged , . Bookmark the permalink.

Comments are closed.