View Full Version : Conditional Statement Syntax
Using the following nested conditional statement
if(Occupancy="A",M.O.L.=49,if(Occupancy="B",M.O.L.=49,if(Occupancy="M",M.O.L.=49,if(Occupancy="I",M.O.L.=10,if(Occupancy="R",M.O.L.=10,if(Occupancy="S",M.O.L.=29,0))))))
I get the following error message:
"The following is not a valid schedule field: M.O.L.
This conditional statement was applied to a Calculated Value within a schedule with the given name M.O.L.
So I assumed that the conditional statement must reference an external parameter not itself, so when I make M.O.L. an separate schedule field I get the following message:
"Improper use of boolean expressions"
Is my syntax wrong or is it something else?
Calvn_Swing
2008-03-19, 10:07 PM
if(Occupancy="A",M.O.L.=49,if(Occupancy="B",M.O.L.=49,if(Occupancy="M",M.O.L.=49,if(Occupancy="I",M.O.L.=10,if(Occupancy="R",M.O.L.=10,if(Occupancy="S",M.O.L.=29,0))))))
In Revit, conditional assignments are assumed. So, the correct syntax for your statement is:
if(Occupancy="A",49,if(Occupancy="B",49,if(Occupancy="M",49,if(Occupancy="I",10,if(Occupancy="R",10,if(Occupancy="S",29,0))))))
Now, the only question is whether Revit will let you drive a numeric parameter value off a text parameter value... Not sure about that one...
That doesn't seem to be working
if(Occupancy="A",49,if(Occupancy="B",49,if(Occupancy="M",49,if(Occupancy="I",10,if(Occupancy="R",10,if(Occupancy="S",29,0))))))
Only gets me the "improper use of boolean expression" message. Kelly did you get this syntax to work?
Steve_Stafford
2008-03-20, 05:56 AM
Don't think you are going to get that to work with that strategy. Revit doesn't seem to be willing to reconcile the "text" parameter occupancy as a valid value to determine what response to provide to your calculation. You can use a schedule key however to choose the occupancy type and provide the value you need. Then you can use a calculated value to do more work on that.
Try taking the exclimation marks and try not to use fullstop in your parameter names. I had problems with that before. Otherwise it looks like the conditional statement should work.
Thanks Steve!
Sometimes backing up and taking a different road can get you where you want to go. Appreciate the road map.
Calvn_Swing
2008-05-19, 06:12 PM
Glad you got it to work, key schedules are a great tool for this situation as they basically handle the formula for you. However, I got the formula to work fine - though I tried it in a family not a schedule calculated value. Sometimes Revit is tricky and lets some things work in one situation and won't let them work in another...
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.