Revit Architecture Forum
Welcome to Autodesk’s Revit Architecture Forums. Share your knowledge, ask questions, and explore popular Revit Architecture topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trigonometric functions in formulas

14 REPLIES 14
SOLVED
Reply
Message 1 of 15
Anonymous
17537 Views, 14 Replies

Trigonometric functions in formulas

I'm trying to create formulas based on trigonometric functions to define parameters in a family (I'm using Revit 2017).  According to the Revit documentation, the basic trig functions should be available; the "valid formula syntax" for them (sine, cosine, tangent, arcsine, arccosine, arctangent) are all defined here:

http://help.autodesk.com/view/RVT/2017/ENU/?guid=GUID-B37EA687-2BDF-4712-9951-2088B2A8E523

 

However, even the simplest formulas I create based on trig functions bring the error:

"The following is not a valid parameter: cos 4

Note that parameter names are case sensitive."

 

(In the above example, the formula I entered was "cos 4/3".  I get an equivalent message for any other formula based on trig functions.)

 

This suggests to me that Revit doesn't actually recognize the trig abbreviations (sin, cos, tan, asin, acos, atan) for these functions; when I enter them Revit thinks that I'm trying to enter the names of parameters that aren't defined.  Note that these are the abbreviations that the aforementioned link says are supposed to be valid in Revit.  I have also tried nonabbreviated versions (e.g. sine, cosine, arctan, arctangent), with the same result.

 

As a test, I tried out some formulas using abbreviations/syntax for mathematical operations that AREN'T trig functions: "sqrt" for square root, "abs" for absolute value.  Those worked as expected.  So it's not that my basic approach is wrong, such as how to enter these formulas in the first place.  It really seems like Revit just doesn't recognize the syntax that it's supposed to recognize.

 

Any ideas?

 

 

 

 

 

14 REPLIES 14
Message 2 of 15
barthbradley
in reply to: Anonymous
Message 3 of 15
L.Maas
in reply to: Anonymous

See two examples hereunder

Capture.PNG

You have to make sure that the result on the left and right of the equation come to the same unit

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

Message 4 of 15
Anonymous
in reply to: Anonymous

Well...shoot....was going to share the cheat sheet for all things formula related at revitforum.org but we are currently switching over the site to another provider.  When we are back up again I'll post the link here.

Message 5 of 15
barthbradley
in reply to: Anonymous

Is this what you were looking for, @Anonymous ?

 

https://www.revitforum.org/tutorials-tips-tricks/1046-revit-formulas-everyday-usage.html

 

I was thinking of Munkholm too, but couldn't access Revit Forum yesterday. In fact, I haven't been able to access the site for the last two weeks.  Today; no problem.  

 

 

Message 6 of 15
Anonymous
in reply to: barthbradley

Yep...that was it.  

 

Glad the transition is done...it's been weird not having access to the site.  For a while I still had access while nobody else did, glad it has been sorted

 

Message 7 of 15
fambrocio
in reply to: Anonymous

Hi @Anonymous. Any update on this? I think they didn't get the problem. 

Same issue on my end. I'm aware of the valid formula syntax to use but Revit did not recognized it. Is there any problem or missing in my Revit software?

 

 


@Anonymous wrote:

I'm trying to create formulas based on trigonometric functions to define parameters in a family (I'm using Revit 2017).  According to the Revit documentation, the basic trig functions should be available; the "valid formula syntax" for them (sine, cosine, tangent, arcsine, arccosine, arctangent) are all defined here:

http://help.autodesk.com/view/RVT/2017/ENU/?guid=GUID-B37EA687-2BDF-4712-9951-2088B2A8E523

 

However, even the simplest formulas I create based on trig functions bring the error:

"The following is not a valid parameter: cos 4

Note that parameter names are case sensitive."

 

(In the above example, the formula I entered was "cos 4/3".  I get an equivalent message for any other formula based on trig functions.)

 

This suggests to me that Revit doesn't actually recognize the trig abbreviations (sin, cos, tan, asin, acos, atan) for these functions; when I enter them Revit thinks that I'm trying to enter the names of parameters that aren't defined.  Note that these are the abbreviations that the aforementioned link says are supposed to be valid in Revit.  I have also tried nonabbreviated versions (e.g. sine, cosine, arctan, arctangent), with the same result.

 

As a test, I tried out some formulas using abbreviations/syntax for mathematical operations that AREN'T trig functions: "sqrt" for square root, "abs" for absolute value.  Those worked as expected.  So it's not that my basic approach is wrong, such as how to enter these formulas in the first place.  It really seems like Revit just doesn't recognize the syntax that it's supposed to recognize.

 

Any ideas?

 

 

 

 

 


 

Message 8 of 15
fambrocio
in reply to: Anonymous

See sample. Not sure what's the problem.

Capture.JPG

Message 9 of 15
loboarch
in reply to: fambrocio


@fambrocio wrote:

See sample. Not sure what's the problem.

Capture.JPG


This one is failing because of units, just as the error says. 

 

In this case parameter "B" is expecting a unit type of "Angle". The formula you have put in does not return a value as an Angle. It returns a simple ratio. Just a number. "Numbers" are not "Angles"

 

2019-05-24_0813.png



Jeff Hanson
Principal Content Experience Designer
Revit Help |
Message 10 of 15
ToanDN
in reply to: Anonymous


@Anonymous wrote:

I'm trying to create formulas based on trigonometric functions to define parameters in a family (I'm using Revit 2017).  According to the Revit documentation, the basic trig functions should be available; the "valid formula syntax" for them (sine, cosine, tangent, arcsine, arccosine, arctangent) are all defined here:

http://help.autodesk.com/view/RVT/2017/ENU/?guid=GUID-B37EA687-2BDF-4712-9951-2088B2A8E523

 

However, even the simplest formulas I create based on trig functions bring the error:

"The following is not a valid parameter: cos 4

Note that parameter names are case sensitive."

 

(In the above example, the formula I entered was "cos 4/3".  I get an equivalent message for any other formula based on trig functions.)

 

This suggests to me that Revit doesn't actually recognize the trig abbreviations (sin, cos, tan, asin, acos, atan) for these functions; when I enter them Revit thinks that I'm trying to enter the names of parameters that aren't defined.  Note that these are the abbreviations that the aforementioned link says are supposed to be valid in Revit.  I have also tried nonabbreviated versions (e.g. sine, cosine, arctan, arctangent), with the same result.

 

As a test, I tried out some formulas using abbreviations/syntax for mathematical operations that AREN'T trig functions: "sqrt" for square root, "abs" for absolute value.  Those worked as expected.  So it's not that my basic approach is wrong, such as how to enter these formulas in the first place.  It really seems like Revit just doesn't recognize the syntax that it's supposed to recognize.

 

Any ideas?

 

 

 

 

 


"cos 4/3" is a wrong syntax, it should be "cos (4/3)"

Message 11 of 15
loboarch
in reply to: ToanDN

Just for the benefit of others reading this post, the first help link provided is from 2017

http://help.autodesk.com/view/RVT/2017/ENU/?guid=GUID-B37EA687-2BDF-4712-9951-2088B2A8E523

 

 

That page was updated recently (2019?) to provide better examples and syntax for the functions used in formulas.

http://help.autodesk.com/view/RVT/2020/ENU/?guid=GUID-B37EA687-2BDF-4712-9951-2088B2A8E523 



Jeff Hanson
Principal Content Experience Designer
Revit Help |
Message 12 of 15
fambrocio
in reply to: loboarch

Thanks @loboarch.

 

All good now. Cheers!

Message 13 of 15
Anonymous
in reply to: fambrocio

Hi Guys, Really need your help about this.

 

i want to get the angle of  triangle with this formula,

it always says inconsistent units. can you help me please? thanks a lot.

 

here's my syntax for the parameters inside the family i'm creating.

=acos((B^2)+(C^2)-(A^2) / (2 * (B * C))

Message 14 of 15
barthbradley
in reply to: Anonymous
Message 15 of 15
barthbradley
in reply to: Anonymous

.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report