Revit Architecture Forum
Welcome to Autodesk’s Revit Architecture Forums. Share your knowledge, ask questions, and explore popular Revit Architecture topics.
abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 

Can't evaluate square root formula

6 ANTWORTEN 6
GELÖST
Antworten
Nachricht 1 von 7
brenTRONwiberg
405 Aufrufe, 6 Antworten

Can't evaluate square root formula

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! 

Beschriftungen (4)
6 ANTWORTEN 6
Nachricht 2 von 7
brenTRONwiberg
als Antwort auf: brenTRONwiberg

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

 

Nachricht 3 von 7
robert2JCCH
als Antwort auf: brenTRONwiberg

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

 

Nachricht 4 von 7
ToanDN
als Antwort auf: brenTRONwiberg

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

 

ToanDN_0-1716262805040.png

 

Nachricht 5 von 7
barthbradley
als Antwort auf: brenTRONwiberg

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

 

2 ARC.png

Nachricht 6 von 7
brenTRONwiberg
als Antwort auf: barthbradley

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

 

Nachricht 7 von 7
brenTRONwiberg
als Antwort auf: brenTRONwiberg

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.

Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.

In Foren veröffentlichen  

Autodesk Design & Make Report