- [Instructor] In the last video,we collected all the information we neededfrom each room object,to perform our occupant load calculations.Now let's have Dynamo do the mathand write the data back to each room element in the model.As we've discussed before,a space's occupant load is calculatedby dividing the space's areaby the space's load factor.We have our areas in one list,and our load factors in another.We simply need a nodethat'll divide the first by the second.I'll go ahead and drop in a division node,which we'll find in the Operator Sectionof the Node Library,along with several other nodes for performingcommon math functions.

I'll plug our list of areas into x,and our list of load factors into y.Then I'll hit Run.Let's double-check our node preview.We want to confirmthat the values look realistic and accurate.We'll also want to compare the length of this listto the length of the original list of rooms,since we'll be writing these valuesback to those room objects in the next step.It seems we calculated 24 occupant loadsfrom our original 24 rooms.Good.So the number of items in each list matches up.I'm noticing two things that we should talk about.

The first is thatat index 11, we see the value infinity.How did it get there, you might wonder.Well, let's take a look at index 11of the load factor list.We find the number zero.Follow that wire back to the division node,and you'll see that Dynamo is tryingto divide a number by zero,which is mathematically impossible,so the result is the number infinity.I should mention here that this is less of an accidentthan it might seem.Occupancy-wise, the room that lives at index 11is a special casethat we're going to address in the next video.Besides, Dynamo didn't return a warning,so it's possible this isn't somethingthat we need to worry about.

Let's keep moving forward,and if it presents a problem,we'll take care of it.The second thing I notice is that a lot of the numbersin this list aren't whole numbers.Standard practice when you're calculating occupant loads,is to round these numbers up to the nearest integer,since the occupant load is describinga number of people who should occupy a space.It doesn't make sense for this number to bea fraction of a person.There is a number in the core math section of theNode Library called Round,which rounds a number to the nearest integer.That's close to what we need,but the IBC requires us to always round upfor this calculation,regardless of how small the fraction is.

Nearby, in the same section of the Node Library,is a node called Math Ceiling,which is a programming termfor rounding up to the nearest integer.If we wanted to round down, we could use Math Floor.Since we want to round up,I'm going to drop a Ceiling Node onto our canvas.Then I'll run our occupant loads through itto round them up to the nearest whole number.A yellow node means Dynamo needs to warn us about something.I'll hover over the yellow bubbleto read what the warning says.It seems that the warning is related to the infinity valuein index 11.If we take a look at the Node Preview,the value is simply zero.

This is a much better situation than if Dynamo returneda value like null,which would hold up the entire workflowand require a lot more action on our part to correct.Remember, this zero value is actually intentional.Much like working in Revit,sometimes a warning is just that, a warning.Let's move forward with caution,and again, if we need to take any action we will.Looking at the rest of the information in the Node Preview,our occupant load data is now free from fractions,and it's ready to be writtenback to the room objects in Revit.Let's plug our occupant load list into the value inputof Set Parameter by Name Node.

We'll also create a code block with the textoccupant load, which is the name of the room parameterwe'd like to write this data to.Just like in the last example,we'll plug our list of rooms into the Element input.Now I'll go ahead and hit Run.If the script ran properly,each room in Revit should now have a numberin the occupant load parameter,which was blank before.I'll go ahead and minimize my Dynamo window,and select a room in Revit.If I scroll down in the Properties palette,we do in fact see a number.

This is a good sign.Let's also double-check Dynamo's math while we're here.I'm going to pull up the calculator,and start with the area parameter,which in this particular room is,578 square feet.Then I'll divide it by the occupation load factor,which is 20.28.9 rounded up to the nearest integer is 29,which is the value that Dynamo calculated for us.Excellent, it seems like our script is working.Aside from being able to see occupancy data inNavisworks or BIM 360,another major advantage to recording the occupant loadin a room parameter,is the ability to visualize the datausing a color scheme and plan views,which would not have been possibleif we'd simply treated itas a calculated value in a schedule somewhere.

I'm going to apply a color scheme to my floor plans calledoccupancy load,which highlights rooms in several shades of grey.Darker shades meaning higher occupant loads,and lighter meaning fewer.It also identifies, by highlighting them in red,rooms with an occupant load of 100 people or more.Those are the rooms which requirepanic hardware on the doors,according to the NFPA.Lastly, it also highlights the roomswith an occupant load of zero,like this auditorium with fixed seating.This is the room that lived at index 11and was returning those funny infinity and zero values.

In the next video,we'll look at why this room was an exception to the rule,and we'll calculate its occupant load in a way that'sunique to this room.

Resume Transcript Auto-Scroll

Author

Released

11/7/2016

Dynamo allows Revit users to build custom tools to solve their problems in smarter, faster ways. This course teaches you how to apply basic visual programming concepts to architectural design in Revit, including automating various design, documentation, analysis, and BIM management tasks. Learn how to use Dynamo for numbering rooms, calculating occupant loads, evaluating the efficiency of a room's furniture layout, verifying adherence to building code, and dimensioning rooms. Each chapter features start-to-finish examples of Dynamo in action, solving and automating the kind of tasks architects face every day.