Trigonometric functions in formulas

Anonymous

Trigonometric functions in formulas

Anonymous
Not applicable

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?

 

 

 

 

 

Reply
Accepted solutions (1)
17,528 Views
14 Replies
Replies (14)

barthbradley
Consultant
Consultant

L.Maas
Mentor
Mentor

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.

0 Likes

Anonymous
Not applicable

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.

0 Likes

barthbradley
Consultant
Consultant

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.  

 

 

0 Likes

Anonymous
Not applicable

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

 

fambrocio
Explorer
Explorer

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?

 

 

 

 

 


 

0 Likes

fambrocio
Explorer
Explorer

See sample. Not sure what's the problem.

Capture.JPG

0 Likes

loboarch
Autodesk
Autodesk

@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 |

ToanDN
Consultant
Consultant
Accepted solution

@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)"

0 Likes

loboarch
Autodesk
Autodesk

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 |
0 Likes

fambrocio
Explorer
Explorer

Thanks @loboarch.

 

All good now. Cheers!

0 Likes

Anonymous
Not applicable

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))

0 Likes

barthbradley
Consultant
Consultant

.

0 Likes