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: 

Formula not working correctly in family

23 REPLIES 23
SOLVED
Reply
Message 1 of 24
rosPNXGN
2054 Views, 23 Replies

Formula not working correctly in family

I have a bracket for a speaker that has 3 different pin positions for its tilt. For each pin position, the bracket has a maximum and minimum tilt threshold. For pin position 2 and 3, the formula works fine. For pin position 1, if i type an angle that goes beyond its limit, initially, it looks like Revit has recognised the formula. However, when apply is clicked, it doesn't recognise it and it applies the angle that it can't do. I have checked the formula and it appears to be exactly how it needs to be. Can anyone help? Or is this Revit just being unhelpful.

Labels (2)
23 REPLIES 23
Message 2 of 24
RDAOU
in reply to: rosPNXGN

@rosPNXGN 

 

If it is 3 fixed pin positions only, isn't it easier and more user friendly to have 3x Yes/No parameters say 15/30/45?

 

If angle input is a must...simplify it by using max tilt angle as only ondition (if A>45, 45, A) 

 

 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


Message 3 of 24
rosPNXGN
in reply to: rosPNXGN

I'm not sure how the Yes/No parameter would work with a minimum and a maximum tilt requirement. What you have provided for  the alternative formula is a part of what I have already done. Which works for 2 options, but not one of them, which seems a fault to me

 

Message 4 of 24
RDAOU
in reply to: rosPNXGN

@rosPNXGN 

 

When you said 3 pin positions I assumed 3 fixed position ... meaning if the 3 positions are 15 30 and 45... it cannot happen that the angle is 33 degrees.

 

If it is not the case and the tilt can be anything between 0 and 45... then all you need is if(Tilt < 0, 0, if(Tilt > 45, 45, Tilt))  any other value would be ignored/invalid... or? what did you have in mind?

 

 

 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


Message 5 of 24
rosPNXGN
in reply to: rosPNXGN

The pin positions of the family determine the length away from the wall. For each length position, the bracket has different max/min tilt functions.

2 and 3 options work fine. Option 1, does not. So I am happy with the formula, because 2 an 3 work. but why doesn't 1 work?

 

Message 6 of 24
RDAOU
in reply to: rosPNXGN

@rosPNXGN 

 

What are the values of Angle and Rotation for position 1 supposed to be??? The way you have it set up now...the values seem to be as per the conditions you set in the formula

 

if(Pin position length = 68.4 mm, if(Angle > 45°, 135°, if(Angle < -10°, 80°, Angle + 90°)), Angle + 90°)

 

ie: when PPL is 68.4 Angle is set to 30 degree (condition = 30 + 90 = 120!!!) .... flexing it continues to give correct values ... so I am not sure what is not working

RDAOU_0-1630917321508.png

 

 

 

Note FYI : the positions are types...but the Angle and Rotation u are using are instance. usually the parameters controlling th types are type parameters...

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


Message 7 of 24
rosPNXGN
in reply to: rosPNXGN

Position 1 is max of 15 and min of -45.

Correct, the positions are types, however each bracket used in a project will have a different tilt requirement depending on its location in the room, hence why they are instance parameters.

Message 8 of 24
RDAOU
in reply to: rosPNXGN

 

ummm im not getting it...the formula is working fine for position 1. See screenshot in previous reply

 

 

 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


Message 9 of 24
rosPNXGN
in reply to: rosPNXGN

rosPNXGN_0-1630917935543.png

The angle that you have input as 30 goes beyond the 15degree allowance for that position. 

when a formula is used like this, it will always show the angle that you request, however, the actual angle should be restricted. In this instance, the FIX angle should stop at 105 degrees, not got to 120

Message 10 of 24
RDAOU
in reply to: rosPNXGN

@rosPNXGN 

 

It is 2 conditions which need to be met...

  1. Pin Position Length (48.3 Position 3, 52.8 Position 2, 68.4 Position 1)
  2. Angle

look at your screenshot...the Pin Position Length is 68.4mm (ie: Pos 3) => the following portion of the formula applies...for position 68.4mm you do not have that restriction

  • if(Pin position length = 68.4 mm, if(Angle > 45°, 135°, if(Angle < -10°, 80°, Angle + 90°)), Angle + 90°)

 

If you set the Pin Position Length to 48.3 (ie: Pos 1) then the first condition will take effect

  • if(Pin position length = 48.3 mm, if(Angle > 15°, 105°, if(Angle < -45°, 45°, Angle + 90°))

Formula seems to be working fine as per the set conditions for all 3 positions...You need to go through the type and check both conditions Angel and Position Length...if that is not the value for angle which you need for position 1 then you need to change the position (@68.4mm) of the formula shown above.. adding more conditions something like

 

  • if(Pin position length = 68.4 mm, if(or(Angle = 45, and(Angle > 15, Angle < 45)), 105, ...

 

flex.gif

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


Message 11 of 24
rosPNXGN
in reply to: rosPNXGN

The pin positions are types and I don't want or need to adjust those. The issue is the tilt angles on position 1 ONLY. The formula works on the other 2 options for the min/max tilt. Position 1 TILT is where the issue is

Message 12 of 24
RDAOU
in reply to: rosPNXGN

@rosPNXGN 

 

Again....for position 68.4mm you do not have that restriction read previous reply for alternative condition/formula

 

if(Pin position length = 48.3 mm, if(Angle > 15°, 105°, if(Angle < -45°, 45°, Angle + 90°)), if(Pin position length = 58.2 mm, if(Angle > 30°, 120°, if(Angle < -25°, 65°, Angle + 90°)), if(Pin position length = 68.4 mm, if(or(Angle = 45°, and(Angle > 15°, Angle < 45°)), 105°, if(Angle > 45°, 135°, if(Angle < -10°, 80°, Angle + 90°))), Angle + 90°)))

Snapshot from previous reply:

 

RDAOU_0-1630920314525.png

 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


Message 13 of 24
RDAOU
in reply to: RDAOU

...

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


Message 14 of 24
rosPNXGN
in reply to: rosPNXGN

I'm sorry, as ever, this sort of problem solving can be tricky to follow.

are you telling me that this formula won't work for what I want, but on only position 1?

if(Pin position length = 48.3 mm, if(Angle > 15°, 105°, if(Angle < -45°, 45°, Angle + 90°)),
if(Pin position length = 58.2 mm, if(Angle > 30°, 120°, if(Angle < -25°, 65°, Angle + 90°)),
if(Pin position length = 68.4 mm, if(Angle > 45°, 135°, if(Angle < -10°, 80°, Angle + 90°)), Angle + 90°)))

Could you highlight what is wrong with it, other than the position itself, which I cannot change 

Message 15 of 24
rosPNXGN
in reply to: rosPNXGN

your formula version didn't work either I'm afraid

Message 16 of 24
RDAOU
in reply to: rosPNXGN

@rosPNXGN 

 

RDAOU_0-1630921464897.png

 

Reference to your statement above, I am saying that the 105 degrees restriction for angles greater than 15 and less than 45 is not set in your formula for position 1. It is too many nested ifs and conditions!!!... and I am not exactly sure what the expected output should be. You need to look at the portion of the formula related to PIN Position Length 68.4 and fix those conditions. 

 

flex1.gif

 

 

 

 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


Message 17 of 24
FAIR59
in reply to: rosPNXGN

You seem confused as what position1 is. In the picture (message 9) which is the a picture representing the failure (?) the value for [Pin position length ] is 68.4mm, and not 48.3mm !!! Your formula works fine. I would introduce some extra parameters to make the system more readable. 

FAIR59_0-1631006435658.png

 

Message 18 of 24
rosPNXGN
in reply to: rosPNXGN

I disagree I'm afraid. It seems the formula layout is confusing people. The pin position 1 is 68.4. This is the third part of the formula. The first part which keeps being referred to is Pin position 3. There are 3 types of this family for all 3 pin positions. I have to have the pin position as an instance parameter as the actual angle is variable and that is the only thing I can reference to a type for each pin position.

Message 19 of 24
FAIR59
in reply to: rosPNXGN

message  7

FAIR59_0-1631007244824.png

message 17 (position 1 = 68.4mm)

FAIR59_1-1631007306964.png

 

Message 20 of 24
ToanDN
in reply to: rosPNXGN

Open the revised family and see if it works for you.

ToanDN_0-1631032289899.png

 

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

Post to forums  

Forma Design Contest


Autodesk Design & Make Report