Hell Revit Community,
I am attempting to write a formula that looks at ranges of values instead of a single value -
IF parameter A is 4"-21", THEN parameter A1 = 3"
IF parameter B - 21.5"-23", THEN parameter B1 = 4"
IF parameter C = 21.5"-25", THEN parameter C1 = 5"
Thank you!
Rina
Gelöst! Gehe zur Lösung
Gelöst von martijn_pater. Gehe zur Lösung
Gelöst von barthbradley. Gehe zur Lösung
you mean: A1 =if (and(A > 0' 4", A < 1' 9"), 0' 3", 0')?
What's A1 if False? 0"?
hmmm I'm thinking maybe something like...
A1 --> formula : IF ( AND (A >4" , A< 21"), 3", <else>)
B1 --> formula : IF ( AND (B>21.5" , A< 23"), 4", <else>)
C1 --> formula : IF ( AND (C >21.5" , A<25"), 5", <else>)
or perhaps something for lookup table?
What about this
IF parameter A is 4"-21", THEN parameter A1 = 3"
IF parameter A - 21.5"-23", THEN parameter A2 = 4"
IF parameter A = 21.5"-25", THEN parameter A3 = 5"
.
Something odd about those formulas...are all those parameters in 1 project? if they are, and Parameter A (which I suppose has a unique value) is driving 3 different parameters A1, A2 and A3, what happens to A2 and A3 when the first condition/if statement is satisficed? same when the second and 3rd IFs are satified!
Nest the If/Then statements is such case would be more logical … I think
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
Sorry about that, @ToanDN - I clacked when I should have clicked!
You are right - it should have been
IF parameter A is 4"-21", THEN parameter A1 = 3"
IF parameter A - 21.5"-23", THEN parameter A2 = 4"
IF parameter A = 23.5"-25", THEN parameter A3 = 5"
Just a few comments/questions:) First you are not really writing down ranges [x,y] mathematically here, second you haven't provided a definition of <else> for A1/A2/A3 if your condition in your if statement returns false ie. if it falls outside of this range, third is that parameters A1/A2/A3 can test for the same condition and return values accordingly... Perhaps you could elaborate on what you were trying to make here.
As you've written it down (is/-/=), it's something like A1=3" if A=-17", A2=4" if A is a rational number (lenght/number?)/always true?, A3=5" if A=-1.5"
So I'm going to assume that's not what you meant. ^^ But actually if you want to include 4" and 21" in your specified range [4",21"] = 4"≤A≤21" your formula/conditional statement should look like:
A1 with formula; if(and(not(A < 4"), not(A > 21")), 3", 0")
A2 with formula; if(and(not(A < 21.5"), not(A > 23")), 4", 0")
A3 with formula; if(and(not(A < 23.5"), not(A > 25")), 5", 0")
The formula's posted earlier actually represents the range as (4",21") instead of [4",21"]. Since you haven't specified values for A1/2/3 if A falls outside of these ranges, like barthbradley I've set all of them to 0... But possibly you need it to be something else, that remains unclear...
Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.