View Full Version : Why doesn't Revit know about PI?

jsteinhauer

2009-12-22, 08:09 PM

So I was writing a formula the other day, and I tired using PI as a know variable, and Revit got mad at me. I had to add a numerical parameter then paste the value of PI into it. To my knowledge PI never changes, so why not allow Revit to understand PI. It understand 'Sin', 'Cosin', 'Tan' & sqrt... Why did PI get short straw?

Jeff S.

nsinha73

2009-12-22, 09:07 PM

Oh My Word, what kinda formula are you writing?

gordolake

2009-12-22, 10:33 PM

Pi is some what an unknown and as discussed below from wiki is only ever an approximation showing that revit is indeed correct not to know the exact value of pi.

"π (sometimes written pi) is a mathematical constant whose value is the ratio of any circle's circumference to its diameter in Euclidean space; this is the same value as the ratio of a circle's area to the square of its radius. The symbol π was first proposed by the Welsh mathematician William Jones in 1706. It is approximately equal to 3.14159 in the usual decimal notation (see the table for its representation in some other bases). π is one of the most important mathematical and physical constants: many formula from mathematics, science, and engineering involve π.

π is an irrational number, which means that its value cannot be expressed exactly as a fraction m/n, where m and n are integers. Consequently, its decimal representation never ends or repeats. It is also a transcendental number, which implies, among other things, that no finite sequence of algebraic operations on integers (powers, roots, sums, etc.) can be equal to its value."

jsteinhauer

2009-12-23, 02:08 AM

Oh My Word, what kinda formula are you writing?

Area of a circle = PI * r^2

Thanks,

Jeff S.

jsteinhauer

2009-12-23, 02:15 AM

Pi is some what an unknown and as discussed below from wiki is only ever an approximation showing that revit is indeed correct not to know the exact value of pi.

"π (sometimes written pi) is a mathematical constant whose value is the ratio of any circle's circumference to its diameter in Euclidean space; this is the same value as the ratio of a circle's area to the square of its radius. The symbol π was first proposed by the Welsh mathematician William Jones in 1706. It is approximately equal to 3.14159 in the usual decimal notation (see the table for its representation in some other bases). π is one of the most important mathematical and physical constants: many formula from mathematics, science, and engineering involve π.

π is an irrational number, which means that its value cannot be expressed exactly as a fraction m/n, where m and n are integers. Consequently, its decimal representation never ends or repeats. It is also a transcendental number, which implies, among other things, that no finite sequence of algebraic operations on integers (powers, roots, sums, etc.) can be equal to its value."

Correct PI is an approximation. But Revit should know some representation of PI. As your wikipedia paste states, "π is one of the most important mathematical and physical constants". PI never changes, just the percision at which we calculate it. I'm very happy with six digits to the right of the decimal point. Come on people, we're in the business of designing with geometry. Circles are geometry, right?

Thanks,

Jeff S.

twiceroadsfool

2009-12-23, 02:54 AM

I dont necessarily disagree that it would be useful, i just think its really not a big deal, especially since its a constant. If youre tired of typing it, you just make a Number parameter, and set it equal to however many decimals you like.

Id like it, sure. But i can think of a bunch of reasons it COULD be a hassle, and a hundred things id rather have before it.

Plus, consider this: Revit is terrible about rounding. It *doesnt* do irrational numbers well at all. The way it handles patterns for brick coursing is a perfect example. Rounding in schedules and dimensions are another. The only saving grace is that when ALL units are left to the most accurate revit can bear (1/256"), the only thing that is still problematic is completely irrational things, like the 8/3" brick dimension. (yeah, its *not* 2 171/256").

If they DID have a constant value for PI, id shudder to think of what it would do to math formulas, lol. I use PI and trig functions all the time in Revit. I just make the parameter, and set the formula column equal to it, so no one can mess with it. I dont see the harm in that, i suppose.

swalton240189

2009-12-23, 05:53 AM

http://forums.augi.com/showthread.php?t=104177&highlight=radian

I forgot most of my trig except for the Indian chief SOH-CAH-TOA but I think this thread figured this question out.

DaveP

2009-12-23, 02:52 PM

To my knowledge PI never changes, so why not allow Revit to understand PI. It understand 'Sin', 'Cosin', 'Tan' & sqrt... Why did PI get short straw?

You answered your own question.

Pi is a constant

Sin, Cis, Tan, Sqrt are all formulae

jsteinhauer

2009-12-23, 03:21 PM

I dont necessarily disagree that it would be useful, i just think its really not a big deal, especially since its a constant. If youre tired of typing it, you just make a Number parameter, and set it equal to however many decimals you like.

Id like it, sure. But i can think of a bunch of reasons it COULD be a hassle, and a hundred things id rather have before it.

Plus, consider this: Revit is terrible about rounding. It *doesnt* do irrational numbers well at all. The way it handles patterns for brick coursing is a perfect example. Rounding in schedules and dimensions are another. The only saving grace is that when ALL units are left to the most accurate revit can bear (1/256"), the only thing that is still problematic is completely irrational things, like the 8/3" brick dimension. (yeah, its *not* 2 171/256").

If they DID have a constant value for PI, id shudder to think of what it would do to math formulas, lol. I use PI and trig functions all the time in Revit. I just make the parameter, and set the formula column equal to it, so no one can mess with it. I dont see the harm in that, i suppose.

Adding a parameter for PI is exactly what I had to do. My only fear is that someone can change PI since it is a parameter & not hard coded in Revit.

Thanks for the discussion, it's been interesting.

Jeff S.

twiceroadsfool

2009-12-23, 07:01 PM

If you enter the value in to the Formula side, in the family, then they would have to hit Edit Family to modify it. If thats what youre worried about, you have bigger problems, because they can go in the family and mess up ALL of the formulas, and besides the methods in *horrible hacks* to hide parameters, theres no way to prevent that.

Good luck!

bulletproofdesign

2010-09-09, 03:48 AM

Revit does now know about pi

In 2011, if you try to name a 'number' as "Pi" in a family, it tells you that "Pi is a keyword of formula. Please choose a different name"

I am having trouble using it. If anyone figures it out, Please post...

Richard - CSG

2010-09-09, 03:58 AM

Can you create a parameter and call it "_pi" and then just use that in your formulas?

bulletproofdesign

2010-09-09, 04:39 AM

Yes you can, however, 2010 and before, you could 'pi' as a parameter name. I have seen that PI is used in API. I was hoping that Pi was usable as a constant in formulae.... this would save 1 parameter...

Richard - CSG

2010-09-09, 05:06 AM

I see. Have you tried pi, PI and Pi? I thought they were case sensitive on parameters.

rudolfweyers346383

2010-09-09, 07:38 AM

Isn't PI = to (22 / 7)? Cant you then use that in you formula?

patricks

2010-09-09, 01:19 PM

Isn't PI = to (22 / 7)? Cant you then use that in you formula?

no, that's another approximation, and not really a good one either.

I say just type 3.14159265359 (yes I have it memorized out that far, have since the 4th grade :shock: ) in your formula and be done with it.

Alfredo Medina

2010-09-09, 01:37 PM

PI in Revit is: pi()

Assuming that you have a parameter called "Radius", and another one called "Area", the formula for the Area of a circle is:

pi() * Radius ^ 2

See illustration.

rpict

2010-09-09, 02:11 PM

PI in Revit is: pi()

Wow, great.

How did found that?

Is there more hidden mathfunc stuff, like "cosh" or "e"?

-rpict

bulletproofdesign

2010-09-09, 07:58 PM

Richard, I tried PI, Pi, pI and pi and they all return the same error.

Patricks, you are a geek! My calculator only went to 3.141592654

Alfredo, Genius!! I tried a few things with parenthesis though not empty!! YAY!

I have used 3.1415 as an approximation which is more than accurate enough for revits precision levels, though now I can use the unreal thing!!

Rpict, there are many operators you can use. exponents (exp), absolute value (abs), sine (sin), cosine (cos), Tangent (tan), blah... search for formula in the help file. It tells you loads about formulae, just not pi!!

sthedens

2010-09-09, 08:23 PM

Speaking of undocumented math functions...

Did we ever find out if the LOG function is base 10 or base "e" or base ???

bulletproofdesign

2010-09-09, 08:39 PM

Speaking of undocumented math functions...

Did we ever find out if the LOG function is base 10 or base "e" or base ???

Um..... 15 seconds later.... Base 10

Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.