Thursday, January 24, 2008

Neutralize those units!!!

It is possible this tip has been blogged before, but it’s worth refreshing just in case. Sometimes there will be situations when creating parameters in your Revit families, when you would like to multiply one parameter by another parameter to get a result. So in this simple example we have two parameters A_length and B_length and we would like to multiply these together to get a resulting new "length". Both parameters have been setup as “length” parameters.

The natural thing to do would be to create a new calculated “length” parameter and setup the formula as

A_length * B_length

However, if you do this in Revit you get this!!!! Ouch


What do you mean inconsistent units!!!! I…… don’t bbbbbbbelieve it!! So you swear at Revit and you wonder what your next move should be.

Well you actually have to neutralize the units in one of the parameters to get the result. Revit seems to be rather fussy about multiply two parameter of the same type together. It’s not like Excel. So if you divide one of the parameters by 1, this neutralizes the units and allows the calculated formula to perform correctly.

A_length / 1 * B_length It’s a similar process if you have two “number” parameters and you want to multiply these together to get a resulting “length” parameter. So we have two parameters X and Y setup as “number” parameters. We’d like to multiply these together to get the result as a new “length” parameter.
Again, we get the same inconsistent units message if we just try to multiply these together.
However, this time if we multiply one of the parameters by 1 to reinstate the units, the calculated formula will now work.

A_length * 1 * B_length Good luck and happy formula creation.

5 comments :

Wes said...

hey -thanks! I had this happen the other day and was too p.o'd to search it out on AUGI. This is possibly the stupidest programming error I've ever heard of, with the possible exception of that whole metric vs imperial screwup on the Mars mission a few years back. Hope they fix it in Revit 2009.

Unknown said...

Dear David,

It would help if you provided an example. What exactly is this parameter of the dimension "length" that you have in mind that is a multiple of two other length parameters? I always thought that when multiplying two lengths one gets an area...

me said...

The above post is correct. Revit is in fact right. mm*mm=mm sqared so the variable can not be the same.

This is in fact a workaround IF you want the "numbers" to be ok and lose the units.

Quite a fancy idea i must admit.

Unknown said...

wow.this is to tell you guys, this stupid error is not fixed in Revit 2010... and also many thanks for your method!
you saved my life!

mooseskinner said...

You heard me swearing at Revit again. Thank you for this tip! I am definitely following you guys!