Goal amount for this year: 2500 USD, Received: 1627 USD (65%)

# Thread: Revit Formulas for "everyday" usage

1. ## If I know C and and S, can I get R? Originally Posted by Munkholm Ever needed to calculate circular segments? Made this one earlier, to get the radial arrays right in this family, but figured that it might come in handy for something else, so saved it out at a early stage. If I know C and and S, can I get R?

PS: this if from the circular segment formula.  Reply With Quote

2. I believe that it should be possible, but surely would be easier to get R if you also know h

Link to the article I used back then: https://en.wikipedia.org/wiki/Circular_segment  Reply With Quote

3. Yes, I also expect it to be possible... Been wrestling with it for a few day now though :-)  Reply With Quote

4. Originally Posted by Munkholm I believe that it should be possible, but surely would be easier to get R if you also know h

Link to the article I used back then: https://en.wikipedia.org/wiki/Circular_segment
From that wiki:
One can reconstruct the full dimensions of a complete circular object from fragments by measuring the arc length and the chord length of the fragment.

So, it should be possible... no luck so far though :-(  Reply With Quote

5. Found an article which suggest that it's only possible to do an approximation with Newton's method (Sometimes called the Newton-Raphson method)

I'm usually pretty good at this stuff, but this one have me puzzled, and I'm starting to think that it's not possible after all. But please do let me know if you figure it out.

Given the arc length and chord length, what is the radius? - Math Central  Reply With Quote

6. yes, I found those too. I believe you are correct, if smarter guys as us can't find a solution, we should probably just give up I will be looking at the approximation, maybe combined in a lookup table to come to a solution for the family.  Reply With Quote

7. Hello, I don't know if this had been posted before, but I could not find it anywhere here, so I am going to add this info to this thread in case it's useful for someone in the future: how to find the cube root of a value in Revit.

You know that for square roots we have a function, so we simply type sqrt (x) to find the square root. For example, if x = 16, then sqrt (x) is 4.
But how do we get the cubic root of a value? I thought there was a function for it, such as crt (x) or cubicroot (x), or croot (x) but no, none of those functions exist in Revit.

So the syntax for cubic root is this: x ^ (1/ 3)
For example, you have a parameter x whose value is 129, and you need a number that x * x * x is 129, then you create a new parameter, say "y" and make it equal to x ^ (1/ 3) . The result is 5.052774 , that's the number that multiplied three times by itself gives 129 or actually 128.999...

In the same way, finding the n root of a value x in Revit is: x ^ (1/n)

Why was I needing a cube root? Because I needed to find the radius of a hemisphere given its volume, and I read that the formula requires a cuberoot and I didn't know how to do a cuberoot in Revit.  Reply With Quote

8. ## Help for Circle Segment Calculations Originally Posted by Jaapf If I know C and and S, can I get R?

PS: this if from the circular segment formula.
As others have noted, Revit cannot do calculate the radius from only the chord and arc length since it does require Newton's Method.

See http://mathforum.org/dr.math/faq/faq.circle.segment.html for an excellent, complete, easily used source for calculating any part of a circular hemisphere based on just two parameters. There is a link provided on the site to an Excel file created by Dan Erb with well presented and organized calculations including solving those cases which require Newton's Method. For convenience I am including it here http://mathforum.org/dr.math/gifs/ChordMath.xls. However, together The Math Forum and Dan Erb's spreadsheet provide a very comprehensive understanding and convenience in solving these kinds of problems.  Reply With Quote

9. Hello!

So I've been using Revit on and off for about 3 years now and I'm currently trying to write my first formula. I think I have the "concept" of what I want it to do correct, but Revit keeps scolding me for "Improper Use of Boolean Expressions" and despite all my meddling and reading I can't figure out why.

if(Invert Elevation < 15', Invert Elevation, (Invert Elevation-15'))

That's the formula I have as currently written. What I'm trying to achieve is this:

I have an hvac model with piping. I need to be able to call out the invert elevation of the piping in a tag. The tag I have works great on the first floor of the building, but when I go up to the second floor it still reports the value in relation to "elevation 100", which is 15 feet below the second floor level.
So I created a new parameter in the tag called "Invert Elevation 2nd floor only", to go along with the "Invert Elevation" parameter that's currently in said tag.

I thought if I could get the formula to check to see if the initial Invert Elevation is less than 15 feet I'd have it still report the normal "Invert Elevation" value, but if that parameter read a value *larger* than 15 feet it would take said value and subtract 15 feet from it, then report that final value (giving me an invert elevation based off the second floor plan level instead of the first.)

I hope I explained it clearly enough. If anyone has any input for a formula newbie it'd be much appreciated!

Thanks!  Reply With Quote

10. one thing that could be added is a Simple OR Statement for yes/no parameters

OR (A=True, B=True)
if either A or B is true, then the result is true

despite how easy it turned out to be it's not always immediately apparent how to make a yes/no <true> or <false>

I fell into the trap of trying to do IF ( OR (A=True, B=True) <True>, <False> ) ).....   Reply With Quote

#### LinkBacks (?)

1. ###### 2012 Formule syntaxe - AUGI
Refback This thread
February 28th, 2012, 03:07 PM
2. ###### Untitled document
Refback This thread
January 10th, 2012, 01:31 PM
3. ###### Untitled document
Refback This thread
January 2nd, 2012, 06:57 PM
4. ###### Untitled document
Refback This thread
December 2nd, 2011, 11:31 AM
5. ###### Formulas for &quot;Everyday&quot; Use - WikiHelp
Refback This thread
November 4th, 2011, 09:59 AM

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•