Clicky Web Analytics

Thursday, November 26, 2009

Tutorial - Complex Formulas in Revit (Inconsistent Units)


As many of you may know I am working on a final project for my Calculus class involving Revit (see here and here). Well, I have been working a lot on that (one of the reasons the posting has been a tad slow) and I ran into a problem that some of you may have or will have.

The problem was due to the complexity of the equation I was creating to drive one of my parameters. Here is the equation:


Now, notice the "MIN" is referring to a seperate dimensioned parameter (therefore, it becomes our variable in a sense) and the remainging numbers are fixed. I used meters in order to utlize fractions better and divisions. Now... I go to apply the formula and get this message. (Inconsistent Units).

Then the frustration begins. I tried many different combinations and ways of typing in the formula and could not working. I did some research and found two blog posts that helped me understand what my problem was. It turns out that my problem was not with the actual formula, but the units. Those of you with some Physic's classes in your background will remember this when I break it down. Here is my example:

First, I think about the type of parameter I am making. It is a length parameter. Therefore, the unit it needs to be in is a Meter (not a Square Meter, or Cubic Meter). Now, I look at just the units of my equation:

  • (Meter * Meter Cubed) - (Meter * Meter Squared) + (Meter * Meter)
Which yeilds:
  • (Meter ^ 4 ) - ( Meter Cubed) + (Meter Squared)
These cannot be combined and also cannot create a result that is a length paramter (must be just a meter).
Solution:

The solution is very simple. Set up the equation so that you divide out the remaining Meter units you do not want.
Notice the added division in the formula. Where we yeilded a meter cubed I simply divided the result by 1 meter squared. There you have it. Pay attention to your parenthesise and make sure your result is a single meter.