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…
- Stopping an array breaking
- if(Task 1 Length / Task 1 Spacing < 2, 2, Task 1 Length / Task 1 Spacing)
- Control the number of connectors
- if(Task 2 Connector,3,2)
- Control elements based on Family Type selections
- if(Task 3 Type = Task 3 Size 1, “1”, if(Task 3 Type = Task 3 Size 2, “2”, “3”))
- Using Trigonometry
- Task 4 Offset X * tan(Task 4 Angle)
- Visibility that is mutually exclusive
- Task 5 Value = 1, Task 5 Value = 2, Task 5 Value = 3
- Formulas to display error messages
- if(and(Task 6 Length > 1000 mm, Task 6 Error), “Too big”, if(and(Task 6 Length < 500 mm, Task 6 Error), “Too Small”, “”))
- or(Task 6 Length > 1000 mm, Task 6 Length < 500 mm)
- Controlling a Void cut/uncut
- 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.
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…
Download the Excel file here
Let me know if you find this useful!