# Thread: Revit Formulas for "everyday" usage

1. Originally Posted by ekkonap
Attachment 8467

tested?

Again, any improvement is a bonus, by all means keep trying. I just can't replicate your result.
Well, that's weird. Me neither... I must have done something wrong in my initial test.

2. Ok, this is something that I already posted in another post but I thought it could be useful for somebody else... This i a way to round an array integer without using the "round [up or down]" function that is only available from 2012 version.

Originally Posted by me in the original thread
Imagine you want a max. spacing of 36" and that you use that formula : (Array length / 36") + 1
If you have 37", you'll get 2 (which is the not right answer)

By adding 1.49, Revit will round it up if it's not an exact number.
37/36=1.03
1.03+1.49=2.52
Revit rounds up to 3

If the number you are dividing is exact, Revit will automatically round it down.
72/36=2
2+1.49=3.49
Revit rounds it down to 3 because it stills under the 0.5 rounding limit.

Hope it makes sense...
A formula to round an integer for an array quantity could now be read this way:
(Array length / 36") + 1.49

3. I thought this would be a useful addition to this thread on formulas. This applies to titleblock families:

Creating any 'A' sheet standard size by formula

Parameters:

X = horizontal side of the sheet; length parameter
Y = vertical side of the sheet; length parameter
A# = number of the 'A' size sheet. This parameter drives the height and width dimensions of the sheet; integer parameter.

Formulas:

X = Y / sqrt(2)
Y = 841 mm / sqrt(2) ^ (A# - 1)

Usage:

In a titleblock family, set the length units to millimeters. Create the 3 parameters, X,Y, and A#. Set the width of the titleblock to the X parameter. Set the height of the titleblock to the Y parameter. Now simply change the value of the integer parameter to obtain any 'A' size. It is not necessary to know in advance all the different sizes for the "A" sheet system. The formula will do that. The integer number matches the number of the "A" standard size. For example: you need a A1 size, then set the integer to 1. Since the value of the integer matches the name of the sheet size, its value can be used to drive other parameters in the family. See illustration.

Other ISO series

With a small variation in the formula for "Y", the same math works for obtaining all the sheet sizes of the B and C series, like this:

 Series name Y = A Series 841 mm / sqrt(2) ^ (A# - 1) B Series 1000 mm / sqrt(2) ^ (A# - 1) C Series 917 mm / sqrt(2) ^ (A# - 1)

4. Welcome to the forum Martin, since you will have better luck posting this in the open forum I moved your post HERE.

5. Originally Posted by Alfredo Medina
I thought this would be a useful addition to this thread on formulas. This applies to titleblock families:

Creating any 'A' sheet standard size by formula

Parameters:

X = horizontal side of the sheet; length parameter
Y = vertical side of the sheet; length parameter
A# = number of the 'A' size sheet. This parameter drives the height and width dimensions of the sheet; integer parameter.

Formulas:

X = Y / sqrt(2)
Y = 841 mm / sqrt(2) ^ (A# - 1)
The thing is, once ISO comes to town, math goes out the window. Compare the following formula and its results with the table in Paper size - Wikipedia, the free encyclopedia

X = round(1000/(2^(1/4+1/2*A#)))
Y = round(1000*(2^(1/4-1/2*A#))) edit (sorry about that)

A1 and A2 differ.

6. Originally Posted by ekkonap
The thing is, once ISO comes to town, math goes out the window. Compare the following formula and its results with the table in Paper size - Wikipedia, the free encyclopedia

X = round(1000/(2^(1/4+1/2*A#)))
Y = round(1000/(2^(1/4-1/2*A#)))

A1 and A2 differ.
Ekko, if you refer to differences such as "594.7" different from "594", well, that is because the official ISO "A" list simply dropped the decimals, instead of rounding up or down in a consistent way, like the "round" formula in Revit does. But even like that, the results obtained by the formulas that I posted above comply with the standard, because the standards allow some tolerances in the range of 1.5 to 3 mm. depending on the size of the sheet. In this case, the differences between the results of the formula and the official rounded value are all of them less than one millimeter.

By the way, I did not understand how to use the formulas that you posted. It gives me the correct size for X, but not for Y.

7. Alfredo, the values obtained are indeed well within the tolerances, but that is not what tolerances are for IMO. If you're doing it by math ,why settle for tolerances? I did not know what caused the difference. Are you sure about dropping the last digit? That would result in 840 in stead of 841.

Sorry, formula edited. Zigged when I should have zagged.

dropping the last digit...

value - (value - rounddown(value))

Anyway, a little tweaking does the trick:
X=rounddown(1000.3/(2^(1/4+1/2*A#)))
Y=rounddown(1000.3*(2^(1/4-1/2*A#)))
that'll go straight into my next titleblock, tnx Alf!

Who knows, maybe the square meter was measured on a hot summer day. There's bound to be a story behind this.

8. Originally Posted by ekkonap
• If you're doing it by math ,why settle for tolerances?
• I did not know what caused the difference. Are you sure about dropping the last digit? That would result in 840 in stead of 841.
• Well, to keep the formulas simple.
• No, I was not referring to dropping the last integer, but dropping any decimals and keeping the integers exactly as they are. I see that it might be possible to fix it with "rounddown" but I prefer to keep the formulas simple, as shown above; that gives the integer portion of the sizes exactly as they are listed in the official ISO series A,B, and C.

9. Hey Guys! I was wondering if someone has figured up a way to return a string of text to relate a dimension to block module yet.

I'd like to have a parameter that says "Module" or "NOT" to make it easier on myself. I've figured out something that will work but it's time intensive and doesn't work totally parametric. See below. Please help!

After I wrote this up, I tried another way, and made it work. Posting the result if anyone wants to see it.

I used a Number parameter for Calc, and an Integer parameter for CALC. The number will only be an integer if it is module, therefore CMU Module will return a desired result, whereas when it's a decimal it wont be the same, thus the NOT...

10. I'm having trouble implementing an 'if' formula in my window schedule.

I have a yes/no parameter in the schedule for a roller blind. This feature affects the S.O height, so i want to report the So.Height based on this yes/no parameter.

i have tried using
if(C = yes, A, B)

C is a yes/no parameter
A and B are a length parameter

I get an error saying that 'yes' is not a valid schedule.

Do the parameters need to be shared? i would have thought not as it is just calculating something from the schedule....

Any ideas?

1. ###### 2012 Formule syntaxe - AUGI
February 28th, 2012, 04:07 PM
2. ###### Untitled document
January 10th, 2012, 02:31 PM
3. ###### Untitled document
January 2nd, 2012, 07:57 PM