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: 

Is it possible to write an IF/THEN formula for this situation?

9 ANTWORTEN 9
GELÖST
Antworten
Nachricht 1 von 10
Sahay_R
1587 Aufrufe, 9 Antworten

Is it possible to write an IF/THEN formula for this situation?

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


Rina Sahay
Autodesk Expert Elite
Revit Architecture Certified Professional

If you find my post interesting, feel free to give a Kudo.
If it solves your problem, please click Accept to enhance the Forum.
9 ANTWORTEN 9
Nachricht 2 von 10
barthbradley
als Antwort auf: Sahay_R

you mean: A1 =if (and(A > 0' 4", A < 1' 9"), 0' 3", 0')? 

 

What's A1 if False? 0"?  

Nachricht 3 von 10
martijn_pater
als Antwort auf: Sahay_R

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?

Nachricht 4 von 10
barthbradley
als Antwort auf: Sahay_R

Seriously @Sahay_R ??? 

Nachricht 5 von 10
Sahay_R
als Antwort auf: martijn_pater

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"


Rina Sahay
Autodesk Expert Elite
Revit Architecture Certified Professional

If you find my post interesting, feel free to give a Kudo.
If it solves your problem, please click Accept to enhance the Forum.
Nachricht 6 von 10
Sahay_R
als Antwort auf: barthbradley

.


Rina Sahay
Autodesk Expert Elite
Revit Architecture Certified Professional

If you find my post interesting, feel free to give a Kudo.
If it solves your problem, please click Accept to enhance the Forum.
Nachricht 7 von 10
ToanDN
als Antwort auf: Sahay_R


@Sahay_R wrote:

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"


Are you sure about those?  What if A is out-of-range?

Nachricht 8 von 10
RDAOU
als Antwort auf: Sahay_R

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


Nachricht 9 von 10
Sahay_R
als Antwort auf: ToanDN

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"


Rina Sahay
Autodesk Expert Elite
Revit Architecture Certified Professional

If you find my post interesting, feel free to give a Kudo.
If it solves your problem, please click Accept to enhance the Forum.
Nachricht 10 von 10
martijn_pater
als Antwort auf: Sahay_R

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" :leicht_lächelndes_Gesicht: 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.

In Foren veröffentlichen  

Autodesk Design & Make Report