PDA

View Full Version : Formula in schedule If(and(and ???



archjake
2009-06-20, 12:20 AM
Is it possible to create an If And And formula in revit?
I can get a If And to work all day long but can't get an If And And.

ie: If (and(and( YesN0Parameter, Occupancy>10), Yes, No))
or If (and(and( ParameterA=20, Occupancy>10), Yes, No))

Thanks

Alex Page
2009-06-21, 04:52 AM
Is it possible to create an If And And formula in revit?
I can get a If And to work all day long but can't get an If And And.

ie: If (and(and( YesN0Parameter, Occupancy>10), Yes, No))
or If (and(and( ParameterA=20, Occupancy>10), Yes, No))

Thanks

OK - not sure why you need "And And" but in the examples you show, the following will work. basically you dont put the "Yes,No" at the end - its implied and you dont need the "if" since I take it its a Yes/No Parameter that is using this formula:

and(YesN0Parameter, Occupancy>10)
or
and( ParameterA=20, Occupancy>10)

archjake
2009-06-22, 06:17 PM
As always my post wasn't the complete story but your post for utilizing an And command for a Yes/No parameter was a new one to me. Most people underutilize Yes/No parameters in formulas so thanks for that one.

I did find a solution without an And(And formula but had to break my problem into separate parameters with separate results.
Essentially I had to check for 3 items to output the results.
Items 1 was is the occupancy fire sprinklered - from a yes no parameter.
item 2 is the occupancy greater than the number given in a parameter.
item 3 check for occupancy type/group.
Depending on the checks return a value from key schedule parameter A or B.

To solve I Set the Occupancy group/type from a key schedule.
2nd I used a yes/no parameter to check if the occupancy was greater than the number given in a key schedule parameter.
3rd Return a numerical result to a parameter (from parameter A or B) depending on fire sprinklers or not.
Then 4th use an If(And formula to check if item item #2 was a Yes and if so return result of #3. If No return a result of zero as a N/A.

Very confusing - even if we did have an If(And(And formulas to use.

All of this pertains to trying to capture Table 1017.1 from the IBC into a code analysis schedule which I did accomplish after many many hours of developing the process.

On a side note why doesn't a (Not) Yes/No parameter return a result in schedules like it does for family parameter calculations? I submitted this to support and have not received an answer yet.

Alex Page
2009-06-22, 09:26 PM
On a side note why doesn't a (Not) Yes/No parameter return a result in schedules like it does for family parameter calculations? I submitted this to support and have not received an answer yet.

I think you need Shared Parameters to be able to schedule them...is this what you mean???

But to get back to your 'explained' question: - Using an 'And, And' formula
Simple example (you can change the equation itself to suit)
Lets say you need para1 to equal yes if paraX = yes, paraY = 4 and para Z = 5
Syntax would be
para1 = and (paraX,and (paraY=4,paraZ=5))

You can keep on going and going, as long as you put the 'And' of 'If' statement in the correct place.

ie: if your want Para2 to equal yes if paraX = yes, paraY = 4 and para Z = 5 and paraA = yes and Para B = no you could write
para2 = and (paraX,and (paraY=4,and (paraZ=5, and (paraA, not(paraB)))))

This can quickly get very long and hard to understand and check so I might split it:

Add anouther variable paraC and have two formulas
First formula
paraC = and (paraX,and (paraY=4,paraZ=5))
Second formula
para2 = and (paraC, and (paraA, not (paraB))

so para2 returns correctly for both examples above

Hope this is understandable and the examples will help

(Note I havent checked the exact syntax above....but hopefully you'll get the idea!)