Forums
Forums >> Revit Building >> Technical Support >> Help with If then statement
|
|
active
Joined: Mon, Dec 17, 2007
83 Posts
|
I am trying to make a schedule that will tabulate the occupant load of a room. I have figured out how to create a variable in the schedule called Area_Per_Occupant and then create a field that will divide the Area/area_Per_Occupant. This works well, but now I want to go to the next level. There are some areas that are not computed by a net area per occupant. Rather, they are simply a stated number of occupants based on an actaul count. So, I thought I could make a new parameter called Net (yes/No). I figures I could change my formula for Occupant Load to be something like: If Net=Yes then Area/Area_Per_Occupant else =Actual_Count. It does not work and I don't know if I am writing the If>Then>Else statement correct or something else. Also, I would prefer that these Parameters be part of the Room information, but I have never used shared parameters before and don't know how I go about it. Any suggestions would be great.
|
This user is offline |
|
|
|
active
Joined: Mon, Dec 17, 2007
83 Posts
|
I have figured out how to get my schedule to do what I want. I made some shared parameters: Area_Per_Occupant, Net, and Actual_Occupant_Load. the problem I was having was that I had originally made the Net parameter a Yes/No parameter and I was trying to make the I/Then statement be If(Net=Yes,Area/Area_Per_Occupant,Actual_Occupant_Load). This would not work. I changed the Net parameter to a number and then I was abler to redo the formula as: If(Net=1,Area/Area_Per_Occupant,Actual_Occupant_Load). This gives me either the actual occupancy if Net is set to 0 and gives me the calculated occupancy if it is set for 1. I have encountered a new problem though and am stuck. I want to make a life safety plan with a tag that will list the Room Area, Area Per Occupant, and the Occupant Load. I made this tag by copying theroom tag and adding two more labels:Area_Per_Occupant, and Occupant_Load. For both of these labels, I selected the appropriate Shared Parameter. I loaded the tag into my project and the Room Area Shows up, but not the Area Per Occupant or the total Occupant Load. Anyone know what I am doing wrong?
|
This user is offline |
|
|
active
Joined: Sat, Feb 4, 2006
425 Posts
|
Hey mthurnaur, Nice job figuring out your post. As for the visibility issue, Did you build a visibility parameter to allow the user to turn of/on the labels? The first place I would check is in the properties if there is an option to turn them on/off and if not then I would look at the family to sse if the visibility is turned of in there. HTH Brett
-----------------------------------
"You cannot escape the responsibility of tomorrow by evading it today. " ~ Abraham Lincoln |
This user is offline |
|
|
active
Joined: Mon, Dec 17, 2007
83 Posts
|
There is a visibility parameter, but they are both on. The tag shows a question mark for each of the missing parameters.
|
This user is offline |
|
|
active
Joined: Sat, Feb 4, 2006
425 Posts
|
Sounds like the parameters need to be added to the project. Try going to the SETTINGS menu > PROJECT PARAMETERS and add the parameters through there as well. All you have to do is tell the parameter that it belongs to the ROOMS category, if it is TYPE or INSTANCE and what not. These parameters should be SHARED if they are not, it will make life easy. HTH, Brett
-----------------------------------
"You cannot escape the responsibility of tomorrow by evading it today. " ~ Abraham Lincoln |
This user is offline |
|
|
active
Joined: Mon, Dec 17, 2007
83 Posts
|
I got it to work now. Apparenty the program is sensative to the order in which you establish the parameter. I am using the hidden column technique that others have mentioned for reprting the Occupant Load in the tag.
|
This user is offline |
|
|
active
Joined: Mon, Mar 20, 2006
219 Posts
|
Back to your original question (in case you want to change your's or somebody else has the same question): To check the condition of a Yes/No parameter, you don't need the "=" part of your condition. Your formula would read: If(Net,Area/Area_Per_Occupant,Actual_Occupant_Load) If Net is checked it assumes true, unchecked is false. Revit uses the checked state by default.
|
This user is offline |
|
|
active
Joined: Mon, Dec 17, 2007
83 Posts
|
Thanks, I figured that out last night reading an example in another thread. Now here is another formula question. I know that I am probably making this more complicated than it is worth, but I figured I would try it out: I am making a code review sheet. I have completed my egress diagram thanks to the previous posts. Now I want to make a table that lists the required fire resistance ratings of various building components based on the construction class. I thought that I could draw a table and then make a variable CC that would just be text. Then I would have a variable for each building component: Structural Frame, Bearing Walls Interior, Bearing Walls Exterior, etc. For each of those variables, I wanted to make a formula that would read: IF(CC="1A",3,IF(CC="1B",2,IF(CC="2A",1,IF(CC="2B",0,CC)))) I have tried this out and it doesn't work. Is there a better way to do it? Am I writing the formula wrong?
|
This user is offline |
|
|
active
Joined: Mon, Mar 20, 2006
219 Posts
|
It is currently not possible to evaluate a text string in a conditional statement. You can have a conditional statement report a text string, but not check text and base a condition on it. You can have a column where you manually input a numerical indicator that a conditional statement checks to determine your intent. So that you just sort your schedule by your text, batch input the corresponding key number, resort and hide that column. Obviously not appropriate for all situations, but works in a pinch.
|
This user is offline |
|
|
active
Joined: Tue, Oct 9, 2007
285 Posts
|
mthurnauer have you tried useing schedule keys? You can make a set of x=y in a schedule key and then use that in a schedule. It may sound like more work than its worth but you can copy schedules from one project to another which allows you to build out the entire table 1004.1.1 for example. Then you just choose your room type, it inserts the corect value to the schedule and off you go. The only problem with this is that you cannot label a calculated value (although it looks like you managed to do this somehow? The calculated value that I am refering to resides within the project rather than the tag. My way forces you to have a compare values schedule and manually copy one field to another, but you dont have to look up the table every time... This is an example of what I am doing. I would be interested to see your method. Nick
|
This user is offline |
View Website
|
|
|
active
Joined: Mon, Dec 17, 2007
83 Posts
|
I was unable to get a calculated value into the tag. I followed the advice of others on here that suggested having the hidden field in the schedule to copy over all of the calculated occupant loads into a column that puts the number into the tags. it works well. I like how my schedule deals with either Occupant Load Factor or Actual Count. I like what you are suggesting and want to have a table that we can save in our stanards file. I don't know if I fully understand how to do what you are suggesting.
|
This user is offline |
|
|
active
Joined: Tue, Oct 9, 2007
285 Posts
|
Go to View, New, Schedule, and select rooms and then schedule key. By default the schedule comes up with a "Key Name" parameter. Generally this is the driving factor for other schedules. Basically then you add additional columns. IE Occupant Load, etc. Now you can add the "Key Name" and Occupant Load parameters into a regular room schedule. When click on the box for the key name it will come up with a drop down list of key names that you created ealrier. That will automatically fill out the Occupant Load or other parameters that are in both schedules. At first it seems like duplicating work but it makes it alot easier to change values accross a project. If you want we can exchange occupancy schedules. Let me know. My email is kramernicholasm@gmail.com. Nick
|
This user is offline |
View Website
|
|
active
Joined: Wed, Oct 1, 2008
60 Posts No Rating |
Using Revit Architecture 9 Greetings, I have been reading the various threads on Occupant Loads and scheduling, and I am still getting an error with my "if" statement. I would like my schedule to populate a calculated field by dividing the Area x a number. Just like everyone else I guess, but i think my schedule is much simpler. It looks like this: If(Name=B, Area/100, if(name=S2, Area/200, If(Name=R2, Area/50, " ")) etc. The 'Name' is simply the areas occupancy classification as defined by the IBC 2006 (i.e. A, B, I, etc). If someone could also show me how to include the addition of .499 to my result (so the number rounds up or down correctly) that would be great; I thought the person who included this was pretty sharp. I am using the Area tag, and Area plans to generate my code info and the person placing the tag will simply enter the Room use under the Name label. If the "Name" is not listed in the 'If' statement then i would like the field to be left empty (or maybe a - or NA). Thats it...the compound IF statement above seems to work in Excel, but not here. Also, I do not want to mix this up with my architectural room information. thanks j
|
This user is offline |
|
|
active
Joined: Tue, Oct 9, 2007
285 Posts
|
" Using Revit Architecture 9 Greetings, I have been reading the various threads on Occupant Loads and scheduling, and I am still getting an error with my "if" statement. I would like my schedule to populate a calculated field by dividing the Area x a number. Just like everyone else I guess, but i think my schedule is much simpler. It looks like this: If(Name=B, Area/100, if(name=S2, Area/200, If(Name=R2, Area/50, " ")) etc. The 'Name' is simply the areas occupancy classification as defined by the IBC 2006 (i.e. A, B, I, etc). If someone could also show me how to include the addition of .499 to my result (so the number rounds up or down correctly) that would be great; I thought the person who included this was pretty sharp. I am using the Area tag, and Area plans to generate my code info and the person placing the tag will simply enter the Room use under the Name label. If the "Name" is not listed in the 'If' statement then i would like the field to be left empty (or maybe a - or NA). Thats it...the compound IF statement above seems to work in Excel, but not here. Also, I do not want to mix this up with my architectural room information. thanks j " There are a few complications with what you are trying. First I assume that "name" is a text parameter. Unfortunatly text parameters cannot be used in formulas. You can use a formula to drive the results of a text parameter but cannot use a text parameter to drive another parameter. Second is that you cannot use calculated values in tags. Revit calculates the value inside of the schedule and thats where it lives. There is currently no way to connect a schedule calculated value to a tag (even in Revit 2010). The only way you could do this would be to create a (super) complex formula inside of the family to be tagged. However rooms are system families so this doesnt really work for this case either. That said you need to create a schedule that uses numerical (number, length, integer, etc) parameters to drive your calculations. Then add in a shared parameter to the room tag and the schedule. Finally place the shared parameter next to the calculated vaule and manually type the updates. I would explore the idea of schedule keys in lieu of the "name" parameter. This way you can put in the name per the code and have that automaticaly populate the occupancy and exiting requirements. It would make the formulas much simpler to use and update. Revit rounds correctly. So if you just want it to round up (>.5) or down (<.5) it will follow general mathematical rules. However the code requires that you always round up (ie 1.001 occupants should be counted at 2). In this case you need to add .499 to the result of any calculation in order to meet code. Your formulas should look something like this: (Area/200)+.499 Thats the reason that all of our schedules are fairly complex..... HTHNick
|
This user is offline |
View Website
|
|
active
Joined: Wed, Oct 1, 2008
60 Posts No Rating |
Thanks for your response, you are way out in front of me on this stuff. I mis-spoke in my original post; I am using 'Number' not 'Name'. So my IF statement looks like: IF(Number=1, (Area/200)+.499," ". However, if I am understanding you correctly it does not matter because 'Number' is a text parameter (a user can enter either text or number) and as such can not be used in a calculation? Do you think the above IF statement would work if the 'Number" parameter was not a text parameter? Thanks again j
|
This user is offline |
|
|
|
Similar Threads |
if yes/no statement controlled by if yes/no statement |
Revit Building >> Technical Support
|
Tue, Jan 22, 2013 at 4:08:26 PM
|
6
|
Conditional statement |
Revit Building >> Technical Support
|
Thu, Jun 27, 2013 at 9:58:47 AM
|
4
|
LENGTH LIMITING IF STATEMENT |
Revit Building >> Technical Support
|
Tue, Feb 24, 2009 at 7:49:23 PM
|
3
|
Conditional Statement |
Revit Building >> Technical Support
|
Fri, Dec 4, 2009 at 9:49:42 AM
|
1
|
If Statement in Schedules' Calculated Value |
General Discussion >> Revit Project Management
|
Wed, Aug 13, 2014 at 10:13:19 AM
|
4
|
|
|
Site Stats
Members: | 2060754 | Objects: | 23081 | Forum Posts: | 152245 | Job Listings: | 3 |
|