Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Can't evaluate square root formula

brenTRONwiberg
Enthusiast

Can't evaluate square root formula

brenTRONwiberg
Enthusiast
Enthusiast

I Have an arched door panel family that I'm working on which works fine until the width starts to get larger then all the sudden for no reason I start to get "Can't evaluate" errors from the equation for the parameter called "h" 

 

It doesn't like it when the terms inside the sqrt function go to zero.  In other words, it seems to break when it tries to take the square root of zero, BUT... it only does this at larger numbers. 

 

So for example, I'm using the parameters to control the arch at the top of the door.  I want the users to be able to create both a segmented arch (which causes no issue) and also a Roman Arch.  This causes issues because it causes the terms inside the square root to equal zero.

 

In the attached family, you will notice if the door with is say 3' and the arch height is 1'-6" (half the width to make a roman arch) it works just fine.  

If however you have a 5' wide door and then set the arch height to 2'-6" it breaks the "h" parameter.  It makes no sense why one will work while the other does not.

 

If anyone has incite on this I would love to hear.  I've run into this before as well with arched window families which work up until 10' wide and then break for no reason.    I hate working with curves in Revit! 

0 Likes
Reply
Accepted solutions (2)
424 Views
6 Replies
Replies (6)

brenTRONwiberg
Enthusiast
Enthusiast

As a follow up, please see this video for more details on what is happening:

 

https://www.loom.com/share/f058aa9a24a543b499760822d4292210?sid=4f22777f-677c-4c95-aa73-6424cec48450

 

0 Likes

robert2JCCH
Collaborator
Collaborator
Accepted solution

Put a logic test in to handle the 0 case.

if(r ^ 2 - (c ^ 2 / 4) > 0, r - (sqrt(r ^ 2 - (c ^ 2 / 4))), r)

 

Something like this perhaps?

 

robert2JCCH_0-1716245522950.png

 

ToanDN
Consultant
Consultant
Accepted solution

Ignore the warning in the family, it works fine in project environment.

 

ToanDN_0-1716262805040.png

 

barthbradley
Consultant
Consultant

I've always had better results with 2 Arcs and constraining top quadrants in addition to sides.  

 

2 ARC.png

brenTRONwiberg
Enthusiast
Enthusiast

@barthbradley this is creative, I've never thought about 2 arcs before!

 

0 Likes

brenTRONwiberg
Enthusiast
Enthusiast

Just as a follow up, I really love everyone's suggestions.  I didn't even think to see what would happen in the project environment despite the error.  @ToanDN thanks for pointing that out.  @robert2JCCH The conditional statement is a terrific workaround as well.

0 Likes