Close
About
FAQ
Home
Collections
Login
USC Login
Register
0
Selected
Invert selection
Deselect all
Deselect all
Click here to refresh results
Click here to refresh results
USC
/
Digital Library
/
University of Southern California Dissertations and Theses
/
Automating fire code compliance using BIM and Revit plug-ins
(USC Thesis Other)
Automating fire code compliance using BIM and Revit plug-ins
PDF
Download
Share
Open document
Flip pages
Contact Us
Contact Us
Copy asset link
Request this asset
Transcript (if available)
Content
Automating Fire Code Compliance using BIM and Revit Plug-ins by Wenxin Hu A Thesis Presented to the FACULTY OF THE USC SCHOOL OF ARCHITECTURE UNIVERSITY OF SOUTHERN CALIFORNIA In Partial Fulfillment of the Requirements of Degree MASTER OF BUILDING SCIENCE May 2021 Copyright 2021 Wenxin Hu ii ACKNOWLEDGEMENTS I would like to express my deep gratitude to my thesis committee members, especially Professor Karen Kensek, from the topic selection to the completion of the whole thesis, she always guided me to think and gave me suggestions. Thanks to Cassandra Tomerlin, who is a fire engineer, she gave me inspiration to design these tools and correct my misunderstanding of fire codes. I would also like to thank Professor Marc Schiler for his interpretation in fire codes patiently, and advice on writing skills. Thanks to Chris Tang for helping me deal with programming problems. This was not a regular semester, we worked and studied from home because of COVID, I cannot meet with my classmates, discuss and study together as usual. However, people’s encouragement gave me much courage to overcome difficulties. Thanks to USC for providing me a platform to keep learning and pursue my dream, more importantly, I met a group of lovely people, my classmates and professors. iii Table of Contents ACKNOWLEDGEMENTS ............................................................................................................ ii LIST OF TABLES ......................................................................................................................... vi LIST OF FIGURES ...................................................................................................................... vii ABSTRACT .................................................................................................................................... x Chapter 1: INTRODUCTION......................................................................................................... 1 1.1 Building Information Modeling ........................................................................................... 1 1.2 Revit API (Application Programming Interface) ................................................................. 3 1.3 Fire Code Compliance Automation Potential ........................................................................... 7 1.3.1 Criteria determination ............................................................................................................ 7 1.3.2 Occupancy load ...................................................................................................................... 9 1.3.3 Fire ratings ............................................................................................................................. 9 1.3.4 Fire exits............................................................................................................................... 10 1.3.5 Exit Route ............................................................................................................................ 10 1.4 Summary ............................................................................................................................ 11 Chapter 2 BACKGROUND RESEARCH .................................................................................... 13 2.1 Building Information Modeling ......................................................................................... 13 2.2 Revit API Plug-in Examples .............................................................................................. 13 2.2.1 Example of IFC used for code compliance. ......................................................................... 14 2.2.2 A plugin to create sheets ...................................................................................................... 15 2.3 Fire Code Compliance Automation Potential ......................................................................... 18 2.4 Fire Code Specifics ................................................................................................................. 19 2.4.1 Occupancy Load .................................................................................................................. 19 2.4.2 Fire ratings ........................................................................................................................... 21 2.4.3 Fire exits............................................................................................................................... 23 2.4.4 Exit Route ............................................................................................................................ 24 Table 2.1 Current methodologies .......................................................................................... 28 2.6 Other Fire Software Programs ................................................................................................ 30 Table 2.2 Fire Software Programs ........................................................................................ 30 2.7 Summary ................................................................................................................................. 32 Chapter 3: Methodology ............................................................................................................... 34 3.1 Preparation (Platform Set up) ................................................................................................. 36 iv 3.1.1 Visual Studio (How to use tools to access the Revit API) ................................................... 37 3.1.1.1 Configure a project ........................................................................................................... 37 3.1.1.2 Add references .................................................................................................................. 39 3.1.1.3 Implement Interface .......................................................................................................... 40 3.1.1.4 Build solution file ............................................................................................................. 41 3.1.2 Add-in Manager installation in Revit .................................................................................. 41 3.1.2.1 Load Plugin ....................................................................................................................... 43 3.1.2.2 Run plugin ......................................................................................................................... 44 3.1.3 Tool Test: Get Room Information ...................................................................................... 44 3.2 Programming........................................................................................................................... 48 3.2.1 Tool 1: Calculate the occupancy load for each room .......................................................... 48 Table 3.1: TOOL 1 - Calculate occupant load ...................................................................... 54 3.2.2 Tool 2: Color the fire exits ................................................................................................... 56 Table 3.2: TOOL 2 –Color the Fire Exits ............................................................................. 57 3.2.3 Tool 3: Color code the fire rating of walls ........................................................................... 58 Table 3.3: Color code the fire rating of building elements ................................................... 60 3.2.4 Tool 4: Define which exit door should each room use (exit distribution) ........................... 62 Table 3.4: TOOL 4 - Exit distribution (Define which exit door should each room use) ...... 62 3.2.5 Tool 5: Show the escape route plan ..................................................................................... 64 Table 3.5: TOOL 5 - Show the escape route plan................................................................. 65 3.4 Summary ................................................................................................................................. 67 Chapter 4: Tool Development ....................................................................................................... 68 4.1 Tool 1: Calculate occupant load ............................................................................................. 68 4.1.1 Tool instruction .................................................................................................................... 68 4.1.2 Tool 1 main scripts and its explanation ............................................................................... 73 4.2 Tool 2: Color the Fire Exits .................................................................................................... 85 4.5.2 Tool instruction .................................................................................................................... 85 4.2.2 Tool 2 main scripts and its explanation ............................................................................... 87 4.3 Tool 3: Color code the fire rating of walls .............................................................................. 87 4.3.1 Tool instruction .................................................................................................................... 88 4.3.2 Tool 3 main scripts and its explanation ............................................................................... 90 4.4 Tool 4 (Future work): Define which exit door should each room use (exit distribution) ....... 92 v 4.5 Tool 5: Show the escape route plan ........................................................................................ 92 4.5.1 Tool instruction .................................................................................................................... 92 4.5.2 Tool 5 main scripts and its explanation ............................................................................... 98 4.6 Summary ............................................................................................................................... 102 Chapter 5: Validation .................................................................................................................. 103 5.1 Tool 1: Calculate the occupancy load for each room ........................................................... 103 5.2 Tool 2: Color the Fire Exits .................................................................................................. 105 5.3 Tool 3: Color code the fire rating of walls ............................................................................ 107 5.4 Tool 4 (Future work): Define which exit door each occupant in each room should use (exit distribution). ................................................................................................................................ 109 5.5 Tool 5: Show the escape route plan ...................................................................................... 109 5.6 Summary ............................................................................................................................... 111 Chapter 6: Conclusion, Discussion, and Future Work ................................................................ 112 6.1 Context .................................................................................................................................. 112 6.2 Tool 1 .................................................................................................................................... 116 6.2.1 Current Limitations of Tool 1 ............................................................................................ 116 6.2.2 Future Work Tool 1 ........................................................................................................... 117 6.3 Tool 2 .................................................................................................................................... 120 6.3.1 Current Limitations of Tool 2 ............................................................................................ 120 6.3.2 Tool 2 Future Work ........................................................................................................... 122 6.4 Tool 3 .................................................................................................................................... 125 6.4.1 Current Limitations of Tool 3 ............................................................................................ 126 6.4.2 Future Work for Tool 3 ...................................................................................................... 127 6.5 Tool 4 (not completed).......................................................................................................... 128 6.6 Tool 5 .................................................................................................................................... 129 6.6.1 Current Limitations of Tool 5 ............................................................................................ 130 6.6.2 Future Work for Tool 5 ...................................................................................................... 132 6.7 Other Future Work ................................................................................................................ 134 References ................................................................................................................................... 136 Appendix A ................................................................................................................................. 140 vi LIST OF TABLES Table 2.1 Current methodologies .................................................................................................. 28 Table 2.2 Fire Software Programs ................................................................................................ 30 Table 3.1: TOOL 1 - Calculate occupant load .............................................................................. 54 Table 3.2: TOOL 2 –Color the Fire Exits ..................................................................................... 57 Table 3.3: Color code the fire rating of building elements ........................................................... 60 Table 3.4: TOOL 4 - Exit distribution (Define which exit door should each room use) .............. 62 Table 3.5: TOOL 5 - Show the escape route plan......................................................................... 65 vii LIST OF FIGURES Figure 1.1 Example of namespace (Autodesk, 2020) ..................................................................... 4 Figure 1.2 Example of a Revit API User Interface (Jin,2019) ........................................................ 6 Figure 1.3 Fire Exit Door (Wayne, 2019) ..................................................................................... 10 Figure 2.1 Example of IFC entities on the model (Temel, B., & Başağa, H., 2020) .................... 15 Figure 2.2 BIMFOX_demo Ribbon (Li, 2020) ............................................................................. 16 Figure 2.3 User Control created in BimFox plugin (Li, 2020) ..................................................... 16 Figure 2.4 User Interface of “Create Sheets” (Li, 2020) .............................................................. 17 Figure 2.5 Example of “Create Sheets” (Li, 2020) ....................................................................... 17 Figure 2.6 Occupant load schedule (Tomerlin, 2020) .................................................................. 20 Figure 2.7 Part of table of fire rated door requirements ............................................................... 22 Figure 2.8 Minimum number of exits per story based on occupant load (IBC, 2018) ................. 23 Figure 2.9 Example of Exit Access Travel Distance (EATD) ...................................................... 25 Figure 2.10 Code definition of Exit Access Travel Distance (IBC, 2018) ................................... 26 Figure 3.1: Overall methodology diagram (above); in two pieces to show detail (below) .......... 36 Figure 3.2: Create a new project ................................................................................................... 37 Figure 3.3: Configure a new project ............................................................................................. 38 Figure 3.4: Error Warning............................................................................................................. 38 Figure 3.5: Solution to the Error ................................................................................................... 39 Figure 3.6: Add references ............................................................................................................ 40 Figure 3.7: Implement Interface ................................................................................................... 40 Figure 3.8: Screenshot if the script file built successfully ............................................................ 41 Figure 3.9: Add-in Manager installation path ............................................................................... 42 Figure 3.10: Add-in Manager in Revit .......................................................................................... 42 Figure 3.11: Script of “Hello Revit” ............................................................................................. 43 Figure 3.12: Load “HelloRevit” in Revit ...................................................................................... 44 Figure 3.13: Run HelloRevit.dll ................................................................................................... 44 Figure 3.15: Revit floor plan ......................................................................................................... 45 Figure 3.16: Location of room ...................................................................................................... 46 Figure 3.17: Name of room ........................................................................................................... 47 Figure 3.18: Level of room ........................................................................................................... 47 Figure 3.19: Area and perimeter of room ..................................................................................... 48 Figure 3.20: Maximum floor are allowances per occupant .......................................................... 49 Figure 3.21: Occupant Load Calculation for Areas Without Fixed Seating ................................. 50 Figure 3.22: Occupant Load Calculation for Areas with Fixed Seating ....................................... 51 Figure 3.23: Occupant Load Without Fixed Seating Calculator in Excel .................................... 52 Figure 3.24: Occupant Load With Fixed Seating Calculator in Excel ......................................... 53 Figure 3.25: Add a reference to the dynamic link library for Excel ............................................. 53 Figure 3.26: Create a rule-based filter .......................................................................................... 59 Figure 3.27: Colored walls with fire rating ................................................................................... 59 Figure 3.28: Egress Routes ........................................................................................................... 64 Figure 3.29 Common Path of Travel (IBC 2018) ......................................................................... 67 viii Figure 4.1.1 Revit floor plan ......................................................................................................... 68 Figure 4.1.2 Revit 3D view ........................................................................................................... 69 Figure 4.1.3: Revit rendered view................................................................................................. 69 Figure 4.1.4: Input Occupancy Type ............................................................................................ 70 Figure 4.1.5 Room information form, page 1 ............................................................................... 71 Figure 4.1.6 Room information form, page 2 ............................................................................... 72 Figure 4.1.7 Excel table ................................................................................................................ 72 Figure 4.1.8 Create a new project ................................................................................................. 73 Figure 4.1.9 Design room information form ................................................................................. 74 Figure 4.1.10 Design buttons for the room information form ...................................................... 74 Figure 4.1.11 Design room schedule ............................................................................................ 75 Figure 4.1.12 Design occupancy classification form .................................................................... 76 Figure 4.1.13 User interface of room information schedule ......................................................... 77 Figure 4.1.14 Get room information ............................................................................................. 78 Figure 4.1.15 Get property of rooms and department ................................................................... 79 Figure 4.1.16 Calculate rooms’ area ............................................................................................. 80 Figure 4.1.17 Export to Excel ....................................................................................................... 81 Figure 4.1.18 Display these room data in User Interface ............................................................. 82 Figure 4.1.19 Calculate occupancy load ....................................................................................... 83 Figure 4.1.20 Display total rooms’ information ........................................................................... 84 Figure 4.1.21 Windows Form interface ........................................................................................ 85 Figure 4.2.1 Revit plan view test for Tool 2 ................................................................................. 86 Figure 4.2.2 Plan view of colored exit doors when running Tool2 .............................................. 86 Figure 4.2.3 Main scripts of Tool 2 .............................................................................................. 87 Figure 4.3.1 Revit model in a Plan View ...................................................................................... 88 Figure 4.3.2 Input fire rating value ............................................................................................... 89 Figure 4.3.3 Plan view of colored walls when running Tool3 ...................................................... 89 Figure 4.3.4 Main scripts of Tool 3 .............................................................................................. 91 Figure 4.3.5 Color fill Legend ...................................................................................................... 91 Figure 4.5.1 Revit model with one room ...................................................................................... 93 Figure 4.5.2 Tool 5 user interface ................................................................................................. 93 Figure 4.5.3 Tool 5 result using “All room corners to all doors” command ................................ 94 Figure 4.5.4, 4.5.5 Tips on the lower left corner in Revit (select a room, select a target door) ... 95 Figure 4.5.7 CPOTD lines with one room model ......................................................................... 96 Figure 4.5.8 Tool 5 dialog box...................................................................................................... 96 Figure 4.5.9 Tool 5 user interface ................................................................................................. 97 Figure 4.5.10 Screenshot when running Tool 5 in multiple rooms building ................................ 98 Figure 4.5.11 Information about path of travel line ...................................................................... 98 Figure 4.5.12 Make a selection filter ............................................................................................ 99 Figure 4.5.13 Iterate doors and collect the door’s origin points ................................................. 100 Figure 4.5.14 Find the most remote points in every room .......................................................... 101 Figure 4.5.15 Map all source points............................................................................................ 102 ix Figure 5.1.1 Floor plan and Excel calculator for occupancy ...................................................... 104 Figure 5.1.2: Results calculated by hand .................................................................................... 104 Figure 5.1.3 Results calculated by Tool 1................................................................................... 105 Figure 5.2.1 Plan view before running Tool 2 ............................................................................ 106 Figure 5.2.2 Plan view after running Tool 2 ............................................................................... 106 Figure 5.2.3 Sheet with door schedule and plan view ................................................................ 107 Figure 5.3.1 Result of Tool 3 when setting the fire rating value as “30min” and “1 hr” and nothing in the type parameter ..................................................................................................... 107 Figure 5.3.2 Color fill legend (created manually)....................................................................... 108 Figure 5.3.3 Sheet with wall schedule and plan view ................................................................. 108 Figure 5.5.1 “Path of Travel” command ..................................................................................... 109 Figure 5.5.2 Corner points in the room ....................................................................................... 109 Figure 5.5.3 Line 1 (left), line 2 (right) ....................................................................................... 110 Figure 5.5.5 Line 3 (left), line 4 (right) ....................................................................................... 110 Figure 5.5.6 Tool 5 results .......................................................................................................... 111 Figure 6.1.1 Entire methodology diagram .................................................................................. 114 Figure 6.1.2 Methodology diagram part 1 .................................................................................. 114 Figure 6.3 Methodology diagram part 2 ..................................................................................... 115 Figure 6.2.1 Final output of Tool 1 ............................................................................................. 116 Figure 6.2.2 Input Occupancy Type ........................................................................................... 117 Figure 6.2.3 Properties panel ...................................................................................................... 118 Figure 6.2.4 Room information schedule generated by Tool 1 .................................................. 119 Figure 6.2.5 Excel exported from Tool 1 .................................................................................... 120 Figure 6.3.1 Plan view of colored exit doors after running Tool 2 ............................................. 120 Figure 6.3.2 Door schedule ......................................................................................................... 121 Figure 6.3.3 “Door egress type” parameter ................................................................................ 122 Figure 6.3.4 Auto tag egress doors only ..................................................................................... 122 Figure 6.3.5 Door Schedule ........................................................................................................ 123 Figure 6.3.6 Sheet with door schedule and floor plan ................................................................ 124 Figure 6.3.7 Minimum number of exits per story based on occupant load (IBC, 2018) ............ 125 Figure 6.4.1 Plan view of colored walls after running Tool 3 .................................................... 126 Figure 6.2.3 Color pattern ........................................................................................................... 127 Figure 6.4.1 Revit sheet .............................................................................................................. 128 Figure 6.4.1 Exit distribution plan .............................................................................................. 129 Figure 6.6.1 Result of running Tool 5......................................................................................... 130 Figure 6.6.1 Path of travel lines schedule ................................................................................... 131 Figure 6.6.2 Travel distance and length ...................................................................................... 132 Figure 6.6.3 Example of irregular shaped rooms ........................................................................ 133 Figure 6.6.4 User interface of options to create path of travel (left); Exit path with orthogonal lines (right) .................................................................................................................................. 133 Figure 6.6.5 Very small part of an exit plan for an airport. ........................................................ 134 Figure 6.7.1 Example of Ribbon panel (Autodesk, 2014) .......................................................... 134 x ABSTRACT As a building information modeling (BIM) platform, Revit has powerful modeling tools that can create comprehensive and accurate building data. In addition to using the Revit menu or toolbar commands for architectural design, Revit also provides an application programming interface (API) for external programs to manipulate and access Revit; it also allows users to develop their own customized plug-in tools to including automating repetitive tasks or automatically check specification detection errors. Five BIM aided plugins were planned to be developed in Revit using C# programming language and based on International Building Code 2018 (IBC 2018) as published by the International Code Council (ICC) to assist and check building fire protection design: Tool 1 automatically calculates occupancy load for each room based on the occupant types and area; Tool 2 colors the exit doors red; Tool 3 overrides the cutline of walls in different colors based on their fire rating values; Tool 4 defines which escape doors the room occupants should use (not completed); and Tool 5 generates evacuation lines. Only Tools 1, 2, 3, and a simple version of 5 were eventually written. In order to write Revit plugins and run C# programs, Visual Studio 2019 was used to compile and execute source files in an Integrated Development Environment (IDE). By applying these automatic fire code check tools, the manual checking process which is also an error-prone link can be avoided, and this provides designers with a more streamlined fire code compliance review process. KEY WORDS: Revit API, fire code check, building information modelling (BIM), fire code compliance xi RESEARCH OBJECTIVES • Research current available approaches and tools integrating BIM for fire protection • Analyze code check methodology based on the International Building Code 2018 (IBC 2018) • Calculate occupancy load in Revit for a simple assembly building • Automatically color code fire exits and walls in Revit • Determine exit distribution in Revit (not accomplished) • Create an escape route plan in Revit for a simple case 1 Chapter 1: INTRODUCTION Chapter 1 gives an overview of building information modeling (BIM), the Revit API, fire code compliance, and indicators such as occupancy load, fire exit, fire ratings and exit routes are explained. 1.1 Building Information Modeling The core of BIM is to provide a complete building information database consistent with the actual situation through the establishment of a virtual 3D model, which uses digital technology. The information database not only contains the geometric information describing the materials of building components, but also includes the combustion performance and calorific value of these materials (Zwinger, 2010). BIM can be of benefit to many stake holders like owners, operators and users. With the help of BIM, engineers can easily check the professional 3D model from any angle and intuitively read the designer's intention. Unlike traditional CAD which just used as a source of documentation, BIM also serves as a reservoir of building information (Kensek, 2014). Compared with the conventional 2D drawings, BIM holds more data. A BIM model is a digital building that uses virtual components to express real building components. All contents exist in the form of unique components, such as walls, beams, floors, roofs, doors, and windows (Mathews, 2018). In additional to having the geometric data, the components can also hold data about an object (e.g. R-value, description, width, fire code rating). Because each of them has corresponding size and information content, the building information model is converted into a fire model to improve the accuracy of fire simulation results and greatly save the time of secondary modeling. 2 With the help of BIM, engineers are able to focus more on technical reviews, thus improving the efficiency and accuracy of the project review. In the total plane layout compliance checks, for example, a traditional audit mode is needed to measure the fire compartment area of the building, the width and the length of the escape route, etc. (Cerovsek, 2011). However, in the BIM, the rules can be set reasonably, and the software can automatically calculate the corresponding parameter indicators and compare them with the set limits. An example of this is the stair and ramp generator tool in Revit that use rules of thumb to generate only “reasonable” stairs and 1:12 handicap ramps for wheelchair accessibility; the user has to overrule these settings to create something different, which might not be recommended. It is possible to have design that does not conform to regulations is automatically marked, which greatly simplifies the code check process and improves the efficiency of examination. Also, when BIM technology is applied in the fire design review process of buildings, all relevant information of the project can also be added to the model at different stages so as to form an information database, which can be fully shared. A three-dimensional model has a unique advantage for visual aspects such as basic data extraction and analysis of information that can be realized, the corresponding functions like collision check, feasibility analysis, construction progress simulation, asset management are relatively mature, however, platforms that can realize these functions are limited, and there are still problems in the process, such as data transformation of cross-platform models (Ingram, 2020). In the implementation of BIM, there will also be problems according to different projects. For example, models with simple operation but high repeatability need to take a lot of time of BIM engineers. And some special models need algorithms to implement, people cannot accomplish these models directly by BIM software, therefore, some alternative methods such as using other 3D modeling software first and converting the format, although sometimes the 3 conversion cannot be done, the parameters may be lost or cannot be added (Ingram, 2020). Faced with these existing problems, a good way to effectively solve them at present is developing an Application Programming Interface (API) of BIM software. With the help of APIs, problems such as simple and repetitive work that costs human resources, complex heteromorphic structure can be modeled, seamless connection of data with other platforms can be solved (Banfi, 2019). One task that BIM is used for is to document code compliance. Codes are a standard-setting mechanism to ensure the safety and welfare of building users. An example is the International Building Code (IBC); it is mandatory for building construction. However, reviewing drawings for code compliance is a laborious process since it requires a lot of items to check (Kilkelly, 2018). Since code check is a time-consuming work, speeding up their code compliance review process is much needed to keep up with increasingly tighter construction schedules (Kilkelly, 2018). It would save a lot of time if an architect or building official could press a button and generate a code compliance report automatically. However, although research is being made in that direction, it is not quite a reality in the architecture profession. Building code compliance checks could be realized by integrating an automation of plan view into a BIM software. A code compliance check tool can provide a user interface to guide the engineers to input information of building code into a BIM model such as construction type, size of the building, and the fire ratings of building elements (Clayton, 2013). 1.2 Revit API (Application Programming Interface) BIM (building information modeling) cannot work without effective tools. Revit, as a BIM modeling platform software, provides many functions for users to do 3d modeling and 2d detailing. Revit, by Autodesk, software is one of the many BIM software programs. In addition 4 to using the Revit menu or toolbar commands for architectural design, which are natural for software users, Revit also provides an application programming interface for external programs to manipulate and access Revit. The Revit API is a series of namespaces and class libraries provided by Revit, which are used to help users customize or extend corresponding functions on the Revit platform in the way of programming development (Chen, N., 2016). Namespace code starts with "Using" keyword provided by .NET to avoid naming conflicts and give users access to the classes that contained in the included namespace (Figure 1.1). For example, if two boys have the same last name and first name, they all named John Smith, then people have to find an additional identifier like school name they study in. One study in A school and another study in B school, then SchoolA.Smith.John for one and SchoolB.Smith.John for the other can be used to distinguish them. More specific, a namespace is a method to grouping classes together is a logic way and guide programmers identify which class they wish to use (Autodesk, 2020). Figure 1.1 Example of namespace (Autodesk, 2020) Plug-ins are Class Library assemblies (DLLs) loaded into Revit, which contains the access to Revit applications, documents and parameters. They also contain APIs related to operating and customizing the Revit user interface, including commands, selections, and dialogs (Autodesk, 2020). 5 The API (Application Programming Interface) offers the programmer the system interface to access the resource of the system in the execution and OS (operation system) service. It is also the only way that a program can access the services of the operating system. The program interface of most operating systems consists of a set of system calls, each of which is a subroutine capable of performing a specific function (Chen, N.,2016). Autodesk has offered the Revit API since 2005. At first, API can only access the document object, then in the subsequent versions of gradually increased the functions such as user to select interactive API, document level event APIs mechanism, object filter API, family create API, and so on (Banfi, 2019). Through continuous development, Revit API has formed a complete system where users can realize the original functions of the platform through custom programming, but also combined with interactive operation and program control to complete some modeling work with large amounts of data which has strong regularity (Banfi, 2019). More specifically, API applications can use plug-ins to automate repetitive tasks, or to automatically check specification detection errors, retrieve data for analysis, generate detection reports, etc. One can create a plug-in with the API to mimic commands done in the software itself. For example, to create a seven-story frame structure, engineers can step through using menus or toolbar commands. First create the structure grids, then arrange the column and beam wall, from the first floor to the seventh floor, and finally complete the building model. By using a plugin, the program can automatically create the same building model by inputting the required parameters, such as the number of floors, the number of rooms, the depth, and the other size information. With fewer mouse clicks, engineers can complete the task more quickly. In 6 addition, geometric and attribute information of building model components can be extracted and modified programmatically. The Revit API can meet most of the needs of general architectural analysis. As the number of APIs and the number of people using them increases dramatically each year, the functions of API are constantly developing and will become more and more powerful (Figure 1.2). Figure 1.2 Example of a Revit API User Interface (Jin,2019) Revit API allows users to program in any Microsoft.NET compatible languages such as Visual Basic, C#, C++/CLI, F#, etc. Microsoft.NET framework is a web software development model proposed by Microsoft. C# language is a development tool in Microsoft.NET and it is a modern object-oriented language (Autodesk,2019). 7 Source programs written in C# must be compiled with a language compiler into intermediate language code, forming an extension called exe or dll file. However, since the intermediate language code is not the machine code that can be executed by the computer CPU, the intermediate language code must be translated into the machine code that can be carried out by the CPU when the program runs (Autodesk,2019). In order to write a Revit plugin and run C# programs, Visual Studio must be equipped in the computer, which allows people to compile and execute source files in an Integrated Development Environment (IDE) by selecting shortcuts or menu commands directly (Autodesk,2019). 1.3 Fire Code Compliance Automation Potential Codes play a crucial role in ensuring all kinds of buildings within a governmental jurisdiction; they address many safety provisions like structural stability and fire safety that protect the health, welfare and safety of people through effect code enforcement (Lukasik, 2018). On the process of fire code compliance, the first step is to identify which criteria to follow. Many important indicators like occupancy load, fire exit, fire ratings, and exit routes are defined and specified in building code. 1.3.1 Criteria determination Model codes form the basis of laws and can be adopted by state and local governments, in whole or in part, with modifications. The two main standard-setting organizations are the International Code Council (ICC) and the National Fire Protection Association (NFPA). Architects and engineers must ensure that plans and specifications are in place to meet the requirements necessary to pass the approval process, including referenced codes and standards. The ICC publishes a family of codes referred to as the “I-codes.” There are 15 standards in total, these 8 include the major, most widely used specifications that relate to construction and fire protection, International Building Code (IBC) and International Fire Code (IFC) (Burns, 2020). There are also municipal fire and building codes to be met in many areas. For example, another standard is Part 9 of Title 24 (The California Building Standards Code), which is known as the California Fire Code. The code establishes minimum requirements: under this code, people's health, safety and general property are protected from fire, explosion or hazardous conditions (ICC, 2020). In addition, firefighters and emergency personnel are provided with safe access and necessary assistance (ICC, 2020). Many NFPA standards are adopted by referring to the ICC specification; the two organizations work together to contribute to current U.S. building and fire codes. NFPA and ICC codes reference various organizations’ standards within their requirements (Burns,2020), and once the code is implemented by the Authority Having Jurisdiction (AHJ), these referenced standards are a legally enforceable part of the code. For example, Life Safety Code NFPA 101; Fire Code NFPA 1; the International Building Code (IBC); and the International Fire Code (IFC) all have a chapter dedicated to listing referenced standards by organization, document title, and edition year. New buildings are designed and constructed according to IBC, while changes to existing buildings follow IFC standards. NFPA 1,13,14,20,72 is the most commonly used NFPA standard in the United States, and the current NFPA version varies from state to state (Burns, 2020). The design also depends on the IBC amendment of the state in which the building is located. Strictly speaking, the NFPA standard is the minimum standard for the safety of property, but the owner 9 of the building can require a higher standard of design. This is an important distinction. The building code sets the minimum requirement; the designer can achieve better than the minimum. Many NFPA standards are adopted by referring to the ICC specification; the two organizations work together to contribute to current U.S. building and fire codes. Architects and engineers will refer to all these specifications when formulating structural design standards and other guidelines will be referenced based on who has executive authority. In general, a building inspector uses the International Building Code (IBC), However, fire inspectors will refer to the International Fire Code (IFC), Fire Code (NFPA 1), and Life Safety Code (NFPA 101) adopted by the jurisdiction. 1.3.2 Occupancy load Occupancy load is a term used to describe the number of people that is allowed in a building at one time according to its floor area and function (IBC, 2018). Determining the total occupancy load of the building is an important part in making sure whether the building conforms to the basic concept of building codes that is designed to accommodate all the occupants of the building (Boutin, 2020). 1.3.3 Fire ratings Fire rating means the period of time that a building element or component is able to confine a fire and continue to provide the structural functions. This is measured and determined by a standard fire resistance test (IBC 2018). For example, if a building element is said to have "2- Hour" fire rating, it means that the element has satisfied the requirements for a 2-hour rating specified in a standard ASTM E119 fire resistance test. 10 1.3.4 Fire exits Not all exits from a building are fire exits. In general, a normal exit can be a fire exit, however, a fire exit is not necessarily a normal exit (Wayne, 2019). Fire doors are generally placed to allow for rapid egress in emergencies based on the fire code. They are generally exterior locked and wired to trigger the alarm system to notify others and summon emergency response (Figure 1.3). Fire exits are separated from buildings or isolated in some way and are less likely to catch fire or fill with smoke as easily as the main body of the building as well, to make it easier to escape (NFPA, 2019). Figure 1.3 Fire Exit Door (Wayne, 2019) 1.3.5 Exit Route Exit route is a term used to define a “continuous and unimpeded path of exit travel” from any point in a building to safety outside. Generally, an exit route includes three parts, they are access 11 to the exit, the exit, and the way from the exit to the outside of the entire property. An exit route includes all vertical and horizontal areas (IBC 2018). In the stage of building fire design, fire scene simulation has been carried out on the building. The simulation results can be used directly to avoid problems in a real fire. At the same time, in the process of building use, if there are changes in building structure, function and building materials, the emerging database can be updated synchronously, and then fire scene simulation becomes more convenient. The escape route simulation analysis of fire in buildings is a necessary link for the formulation of digital plan. 1.4 Summary A Building Information Model (BIM) is a data-rich 3D geometric model. It contains information that can be used for energy consumption predicting, cost estimating, structural performance analysis, and even for facility management. In theory, the entire software suite could be linked to a dedicated virtual building description (Kensek, 2014). Codes are guidelines architects and engineers can refer to when designing buildings, on the purpose of creating a safe environment for building occupants. As an indispensable part of buildings, fire safety runs through the whole life cycle of architectural design, construction and operation and maintenance, it is important to evaluate the fire safety level in the building. Automation of fire code compliance can be integrated into Revit plugins; these plugins should be able to provide user interfaces to allow architects and engineers to add building information to the BIM, such as building size, occupancy type, and fire ratings. These plugins could also guide 12 the users to modify their designs based on International Building Code (IBC) through the reports which indicate compliance or against code requirements. 13 Chapter 2 BACKGROUND RESEARCH Chapter 2 gives a background research about building information modeling, Revit plug-ins examples, and fire software program examples. It also includes information from an interview with a fire professional engineer. 2.1 Building Information Modeling Building Information Modeling (BIM) can be used for information storage of 3D visual models for planning, design and maintenance of buildings. A virtual 3D building model is created with specified parametric objects in a digital way, these objects and components can be as detailed and accurate as possible, their properties are displayed in the model which correspond exactly with those in the real world (Ingram, 2020). The process of building information modeling benefits the whole life cycle of a building from its conception, design, construction to management through an intelligent, computer-based model. BIM has become the backbone of modern architecture and infrastructure design, it lays the foundation for a new digital approach that spans the construction industry from urban planning to analysis of structure (Ingram, 2020). BIM proposes to solve this problem that traditional 2D drawings caused, It also encourages coordination and helps enforces design consistency. 2.2 Revit API Plug-in Examples There are thousands of Revit API plugins, some based on C# and some developed in Revit’s visual programming language Dynamo. Professional offices can develop them in house, download free ones on-line, and buy more extensive add-ins. They can be used to automate 14 repetitive tasks, generate new forms, and provide new functionality to Revit. Two examples are IFC used for code compliance and a plug-in to create sheets. 2.2.1 Example of IFC used for code compliance. Building Information Modeling (BIM) is increasingly applied in the AEC field. For one method of interoperability, data is exported in an industry base class (IFC) file format, which allows users to automate the process of checking compliance (Temel, B., & Başağa, H., 2020). Industry Foundation Classes (IFC) are a primary standard used for open BIM data exchange. The IFC transports enough information for the simulation software to read and analyse the IFC spaces in the referenced model (Baldwin, 2019). The IFC specification is developed and maintained by buildingSMART International (formerly known as the International Interoperability Alliance [IAI]). IFC obtains information from various organizations participating in the project (architects, engineers, construction personnel, facility managers, etc.) and all stages of the project life cycle, including initial requirements, design, construction, maintenance and operation. An example of BIM model was designed in BIM based Autodesk Revit 2020 program (Figure 2.1). By matching with the model, the code meaning in the IFC file of the sample building model was examined in detail. It also shows how to filter the build model data required for compliance control from IFC files. It also explains how to test the conformity of the floor height of the sample building model designed within the application scope according to the relevant regulations. Through these checks, data can be obtained from the IFC file format that automatically ensures code compliance checks, and the relationship between the IFC file 15 structure and the automated code compliance checks is also revealed (Temel, B., & Başağa, H., 2020). Figure 2.1 Example of IFC entities on the model (Temel, B., & Başağa, H., 2020) 2.2.2 A plugin to create sheets Revit allows users to customize their own ribbon controls through the API. The relevant interface is in the Revit APIUI.dll, which users need to reference in their own applications. Users need to create custom controls when Revit is launched (Freeman, 2019). Revit API currently offers the following basic controls, Ribbon Tab, Ribbon Panel, Push Button, Pulldown Button, Split Button, Combo box, Radio Button, Text Box and so on (Nelson, n.d.). Where Ribbon Tab and Ribbon Panel are container class controls, which are used to manage the placement of specific controls. The relationship of container and the specific control is that the control must be placed in the Ribbon Panel. (Nelson, n.d.) A Ribbon Tab named BIMFOX_demo was created using the Revit API (Figure 2.2). A Push Button is a single command button which corresponds to an External Command, if a user clicks 16 the button, the corresponding External Command will be executed. “Create Sheets”, “Select Element”, “Match Parameters”, “About BimFox” are Push Buttons (Li, 2020). Because of some barriers that the Visual Studio IDE exists, Users could only create a User Control (WPF) in the Revit Add-in project (a Class Library in the Visual Studio terminologies), Hang Li created a user control and do user interface (UI) element inside it and host the user control into a WPF Window, which was created on the fly (Fig.2.4). Put simply, creating a User Control (WPF) is an important step in making a user interface in his plugin (Figure 2. 3). Figure 2.2 BIMFOX_demo Ribbon (Li, 2020) Figure 2.3 User Control created in BimFox plugin (Li, 2020) 17 Figure 2.4 User Interface of “Create Sheets” (Li, 2020) When the user clicks the “Create Sheets” button, the corresponding External Command can be executed, and a Combo box pops up. Then the user selects a sheet and clicks the “Ok” button and a sheet with corresponding views can be shown (Figure 2.5). Figure 2.5 Example of “Create Sheets” (Li, 2020) 18 2.3 Fire Code Compliance Automation Potential Whether the fire protection is based on performance or compliance with the requirements of the code, with the increasing occurrence of BIM in the construction process, it is possible to theorize the integration of BIM in the fire protection design. To simplify and assist fire engineers, several fire protection software programs have been developed. The principle is to first design the fire pipeline through hydraulics calculation, and then apply the dynamics simulation principle to estimate the escape path of the person. Meanwhile, according to (SFPE 2011), the structure and occupancy rate of the building can be evaluated through the application of fluid dynamics simulation tools, as well as the efficiency of fire appliances can also be evaluated. BIM has the ability to integrate information, and these tools can also be developed for conflict detection to determine the placement of obstacles in escape routes and the extent of smoke dispersion caused by fires. In addition, automated code reviews can provide real-time feedback to fire engineers even though fire design is usually in the final stages of building design (Eastman 2009). It is an emerging domain of BIM-based technology (Preidel, Daum, and Borrmann, 2017) and can be defined “as a software that assesses a design without its modification by applying rules and constraints” (Eastman, 2009). A growing number of research studies are exploring different approaches for automated code checking, including non-geometrical capacities of the building models (Lee et al. 2016), (Hjelseth and Nisbet, 2011)), discussing if present object-based models are adapted ((Greenwood et al., 2010), (Malsane et al. 2015)) or studying rule construction practice ((Solihin and Eastman, 2015), (Porto et al. 2018)). 19 A model is designed to support fire safety management of buildings in Shino’s study (GK Shino, 2013). The evacuation assessment integrates BIM with Fire Dynamics Simulator to calculate the required exit time and the available exit time to assess the building's evacuation capacity in the event of a fire. The planning of escape routes also uses a model to calculate whether the distance of escape route is acceptable. In this tool, device maintenance is implemented as a web-based prototype that supports maintenance tasks by remote management. BIM can effectively provide 3D geometric data to support assessment and planning of fire safety, information stored in web- based networks as well (GK Shino,2013). 2.4 Fire Code Specifics In the International Building code, Chapter 7 "Fire and Smoke Protection Features" and Chapter 10 “Means of Egress” emphasizes many concepts related to fire safety and evacuation plans including occupant load, fire ratings, fire exits, and exit route. 2.4.1 Occupancy Load According to Section 1004 Occupant Load (International Building Code 2018), in the regulation of setting escape exit facilities, the maximum floor area occupied by each person needs to be calculated based on the function of the space. For example, classroom area is 20 square feet per occupant; shops and other vocational room areas are 50 square feet per occupant; and gymnasiums are 15 square feet. How the occupants exit is also important in counting them. When the occupants of the accessory area evacuate through the exit of the main space, the maximum occupant load of the main space needs to calculate the sum of the number of occupants of the main space and the number of occupants of the accessory area (IBC 2018). In actual work, architects usually set the limits of 20 the space within their building design (for example, in the Revit file); each functional area is considered separately and assigned an occupant load based on its use and square footage. The occupant loads of the separate functional areas are combined to determine the maximum allowable occupant load for the space (IBC, 2018). In determining the occupant load, fire specialists in an office (or some other qualified person) creates an occupant load exit calculations schedule including the occupant load (Table 1.1), available exit capacity, and so on. In this example, the load factors were typed in one by one manually from the code sheet in Revit, a formula was added as well, which can be found in International Building Code 2018. Then Revit does the addition automatically. Revit has a tab that can automatically update if the area changes, since the density has already been set to the specific area and occupant load would increase automatically as well (Tomerlin, 2020). Figure 2.6 Occupant load schedule (Tomerlin, 2020) 21 2.4.2 Fire ratings Specifications and the method to determine fire resistance ratings for generic designs can be found in International Building code, chapter 7, “Fire and Smoke Protection Features" (IBC 2018). Fire rated doors are an important part of a building’s fire control system. These include exit doors, corridor doors, and any other protected openings within your building like access doors, roof hatches, or floor hatches. When access doors are closed, they should block gas, smoke and extreme heat from flowing through (IBC, 2018). Approved fire doors should conform to the test requirements and the fire protection rating indicated in Table 716.5 in International Building Code (Figure 2.7). In addition, only doors located within fire rated walls are required to be rated. If an exit door is located within an unrated wall, the door does not need to be rated (Tomerlin,2021). 22 Figure 2.7 Part of table of fire rated door requirements Fire rating requirements must be modeled independently of a single unit, which depends on the function of the space enclosed by the fire isolation zone and the adjacent fire isolation zone. Varies types of buildings have different levels of fire resistance (Zwinger, 2010). The code covers buildings with different levels of fire resistance, such as hospitals, schools, office buildings and residential buildings. Users can choose from these types of buildings, then the fire rating information determined according to the usage will be used to check the internal passage width as required by the code (Lee, 2019). 23 2.4.3 Fire exits The definition of fire exit is explained in Chapter 1; based on that, exit doors must be kept hinged on the side and unlocked on the inside, free of alarms as well. Typically, a building should be equipped with two exit doors in case one of them is blocked, the two exits have to be as far apart as practicality allows depending on the size of building and the number of occupants (NFPA, 2019). Exits must be at least greater than ½ diagonal distance of the overall space, or 1/3 if the building is sprinklered (IBC,2018). The number of exits is determined by the designed occupancy load and floor level. Each story should be equipped with the minimum number of independent exits, as specified in IBC, chapter 1006 "Number of Exits and Exit Access Doorways" (Figure 2.8), and these required number of exits should provide access to exits. Figure 2.8 Minimum number of exits per story based on occupant load (IBC, 2018) Cao have proposed an extended multi-grid model to research fire egress in a room with two exits. The selection of exit was on the basis of random utility theory, and the pedestrian movement in fire was investigated in his study (Cao, 2018). The effect of occupancy types and fire heat release rate is discussed. According to its simulation results, selecting appropriate target 24 exit frequency can alleviate congestion and optimize the evacuation process. The research is helpful in predicting the selection of exit and movement of occupants in a fire emergency and provides a more scientific method to guide egress in fire hazard. However much the research is useful, architects still must obey the building fire code as written. 2.4.4 Exit Route The escape route simulation analysis of fire in buildings is a necessary link for the formulation of digital plan. An escape route is defined in the building code as a permanent fixture in the building, it leads to outdoor areas, and it (usually a corridor) should be wide enough to allow building’s occupants safely. There are formulas in the code to determine the width of corridors and numbers of exits necessary. During the initial design and planning phase of the building project, architects and engineers need to assess and plan fire zones, escape routes and fire equipment areas that comply with the building's fire regulations. At present, most research on BIM in the field of fire safety management focuses on real-time information query and evacuation simulation through relevant building geometric data (Rüppel, U., Stübbe, K. M., & Zwinger, U., 2010). For example, a system has been designed to help emergency workers find the shortest path to a point inland from a complex building. The system provides fire and rescue workers with information about the environment of the building by combining building elements such as doors and walls in a BIM model. In current work, the fire engineer draws exit access travel distance (EATD) lines use 90-degree angles with design flexibility under most situations. (Figure 2.2, shown in green dash line). However, diagonal lines are allowed in some instances, for instance, a designated 25 circulation path for an exit and this area are not allowed to put any furniture, otherwise it is not a visibly designated and have to use right angles (Tomerlin,2 020). Figure 2.9 Example of Exit Access Travel Distance (EATD) Exit routes are defined in the building code as a continuous and unobstructed path of exit travel from any point within a workplace to a place of safety. Egress capacity for each means of egress component is based on clear width of the component and the type of occupancy. Egress capacity for an exit route is determined by figuring egress capacity for each egress component and determining the most restrictive component in the exit tour. In general, the egress capacity feet factor for stairs is 0.3 inches per person and for ramps and level components is 0.2 inches per person (NFPA, 2015). 1. – CPOTD & EATD EATD: exit access travel distance includes the common path, all the way to the exit (Figure 2.10). 26 Figure 2.10 Code definition of Exit Access Travel Distance (IBC, 2018) CPOTD (common path of travel distance). It is defined as “that portion of the exit access travel distance measured from the most remote point within a story to the point where the occupants have separate and distinct access to two exits or exit access doorways (IBC, 2018). 2.5 Current Methodologies in Practice Interview Cassandra Tomerlin is a fire engineer worked in Arup company. She was interviewed via Zoom on September 21, 2020 and in a later follow up interview on October 22, 2020 about how construction documentation is used to show fire code compliance. To show compliance about certain areas of the fire code, the firm creates sheets for the fire marshal to review (Figure 2.11). 27 Figure 2.11 Fire life safety plan and close up of sheet illustrating occupant load and density They generally get the basic data from the architects and then check that the code is being met and create drawings, schedules, tables, and other information to add to the sheet set to be sent for review of code compliance. Tomerlin discussed seven techniques that were used on their fire compliance sheets. 1. Occupant load. (Their methodology is shown in Table 2.1) 2. Travel distance lines 3. Fire rating of walls. (Their methodology is shown in Table 2.1) 4. Exit door - occupancy load per door 5. Function of spaces hatched 6. Fire Dynamics Simulator (FDS) (Summarized in Table 2.2) 7. Real smoke tests (other certified people do that) Tomerlin also discussed two methods for improvement: automatically generate travel distance lines with software and do exit distribution automatically if it changes. 28 Table 2.1 Current methodologies Function Current methodology (Tomerlin,2020) Pictures (Tomerlin, 2020) Calculate occupancy load for each room Create an Occupant Load Exit Calculations schedule including the occupant load, available exit capacity, and so on. The load factors were typed in one by one manually from the code sheet in Revit, add formula as well, which can be found in International Building Code 2018. Then Revit does the calculation automatically. Figure out which is the normal exit and which is emergenc y exit People label them manually base on the function of the spaces and International Building Code requirements. 29 Fire rating of each rooms by room type People define them when make their walls. They filled in what the code is and change the hatch pattern; these are pre- determined line types in Revit. . Define which exit door should each room use Inside Revit, create some custom groupings that include occupants and zones. Then Revit divide the aggregate of all these occupants into exits. If the number of occupants in an exit is overloaded, Revit marks it red, if it is underloaded, Revit marks it green automatically. Evacuatio n Route Plan The fire engineer draws Exit Access Travel Distance (EATD) lines use 90 degrees angles under most situations. (As green dash line shows) 30 2.6 Other Fire Software Programs Three fire software programs are summarized in the table (Table 2.2). There are HydraCAD, SMARTreview APR and Fire Dynamics Simulator (FDS). HydraCAD provides tools for designing Fire Protection systems. SMARTreview APR™ software provides checking reports that the design of buildings against or comply with the code requirements that related to fire ratings, and others. The user interface which is provided by software is able to guide users to add building code information into the BIM, initiating and inspecting plan reviews, and generating reports (Clayton, 2013). Fire Dynamics Simulator (FDS) is a software to predicts smoke and/or air flow movement caused by fire, wind, ventilation systems etc. (Grimm, 2017). Table 2.2 Fire Software Programs Fire Software Programs Name Description Example images HydraCAD (Fire Protection add on to Revit MEP) (Grimm, 2017) • Allows use of any Revit model as a base for the creation of a Fire Protection Sprinkler system. • Provides tools for automatic generation of key sprinkler system components. • Components can be adjusted and connected to create a complete system. • Automatic Layout of sprinklers and piping in defined spaces. 31 SMARTreview APR (Automatic Code Compliance Checking) (Clayton, 2013) TheAPR (Automated Plan Review) software checks the building design against code requirements pertaining to building size, construction type and fire ratings, flame spread classification of finishes, adjacency of occupancies, distance from lot line, and others (Clayton, 2013). An example of the architecture view of APR results An example of configuring Occupant Load 32 Visualization of APR Failures in 3D Fire Dynamics Simulator (FDS) (Harrington, 2020) The NIST Fire Dynamics Simulator predicts smoke and/or air flow movement caused by fire, wind, ventilation systems etc. 2.7 Summary In addition to journal articles, interviews with Cassandra Tomerlin and Hang Li also presented, Cassandra Tomerlin provided information in fire related work and Hang Li provided useful information in writing Revit plug-ins. Building code compliance check is a fairly repetitive and tedious work, which requires people in the whole process of design and construction of project monitoring and maintenance, in the traditional architectural design method based on the conventional CAD model of compliance check, which need a lot of manual intervention and explanations, and makes the inspection process of the specification tedious and time-consuming. 33 In BIM tools, building component's influence on the whole project is associated, so as to adjust the design project makes the whole project in line with the building code, at the same time, in the framework of the collaborative design environment, all project participants can be in the architectural design, in the later period maintenance use BIM to track its design code compliance status. Among all these solutions, none of them addresses properly the link between the rule checking tool and the building model information requirements. Therefore, there is the opportunity of using Revit plug-ins to check fire code compliance. 34 Chapter 3: Methodology Five Revit plug-in tools were created: automatically calculate occupancy load for each room based on the building types, area, size, stories (IBC, 2018); determine the normal exit door and emergency exit; tag the fire rating of each room by room type; define which escape doors the room occupants should use; and calculate escape distance. The overall methodology to accomplish this has three main parts: preparation (platform setup), programming, and validation (Fig. 3.1). 35 36 Figure 3.1: Overall methodology diagram (above); in two pieces to show detail (below) 3.1 Preparation (Platform Set up) This section explains how to prepare for the writing of the five tools. It describes the use of Visual Studio and the Add-In Manager, and then shows a sample plug-in that was written to get room information. 37 3.1.1 Visual Studio (How to use tools to access the Revit API) Visual Studio Professional, which is a powerful IDE (Integrated Development Environment) that enables developers to write codes easily, was used in developing plugins. C# was used to write the plugins. 3.1.1.1 Configure a project The first step was to configure the Visual Studio installation. Depending on the Revit version that one intends to develop plugins for, respective supported .NET version have to be installed. .NET Framework 4.7.2 is required when using Revit 2021 (Fig. 3.2 and Fig. 3.3). Figure 3.2: Create a new project 38 Figure 3.3: Configure a new project There will be an error warning when compiling an application under .NET Framework 4.7.2 in Visual Studio 2019, for this issue is usually related to several versions of the .NET framework installed in the same environment (Fig. 3.4). Figure 3.4: Error Warning The solution is to edit the project file to ignore target framework version mismatches. Open the project file into the editor in the Solution Explorer window and Edit projectname.csproj then add the following element inside the <Project> element as follows (Fig. 3.5). 39 Figure 3.5: Solution to the Error 3.1.1.2 Add references After configuring a new project, for the development environment, references to Revit’s Application Programming Interface (API) were added (Fig. 3.6). The exposed API allows developers to access the data and features of Revit. More specifically, add “Revit API” and “Revit APIUI” under Revit’s Program File in Visual Studio. These are critical for writing a plug- in for Revit. 40 Figure 3.6: Add references 3.1.1.3 Implement Interface Namespaces were added to tell the C# compiler to access the contents of the namespace or specified library assembly (.dll) from the code in this source file and implement an interface called IExternalCommand (Figure 3.7) so that Revit can recognize this interface. Figure 3.7: Implement Interface 41 3.1.1.4 Build solution file When a Revit plugin that was built and run successfully (Fig. 3.8), the next step is to copy addin file to Revit addin directory, which can tell Revit to read the manifest (.Addin) file when users fire up Revit. The AddInManager is the official plugin published by Autodesk, which can run tools in Revit so that the plugin code will be modified easily; it can also reload and run tools without having to restart them. Figure 3.8: Screenshot if the script file built successfully 3.1.2 Add-in Manager installation in Revit Revit 2021 SDK was downloaded from the Revit Developer Center and the Autodesk.AddInManager.addin file was copied into the installation package. The installation path was updated (Fig. 3.9: Add-in Manager installation path). After opening Revit 2021 again, the add-in manager could be found in panel (Fig. 3.10)). 42 Figure 3.9: Add-in Manager installation path Figure 3.10: Add-in Manager in Revit 43 3.1.2.1 Load Plugin A plugin called HelloRevit was created to test the process (Fig. 3.11). First it was created in Visual Studio (Fig. X). Load the plugin HelloRevit.dll being created in Visual Studio (Fig. 3.12: Load “HelloRevit” in Revit) by adding the path of C# script file to “Add-in Manager 2021” Task dialog box. Figure 3.11: Script of “Hello Revit” The path was added to the C# script file. Then the plugin HelloRevit.dll was created in Visual Studio by adding the path of C# script file to “Add-in Manager 2021” Task dialog box ((Fig. 3.12). 44 Figure 3.12: Load “HelloRevit” in Revit 3.1.2.2 Run plugin Click run button in Add-in Manager (Fig. 3.12). When run HelloRevit.dll, a Taskdialog shows “Hello,Revit” will pop up (Fig. 3.13). Figure 3.13: Run HelloRevit.dll 3.1.3 Tool Test: Get Room Information Another tool tested was to get all the room information that users needed. The script was been written and a plugin created similar to the process already described (Fig. 3.14). 45 Figure 3.14: Script of Tool Test: Get Room Information A Revit file was opened. It contained Revit rooms (Fig. 3.15). Figure 3.15: Revit floor plan 46 When loaded and run, the tool went through all room information like room name, room number, location, department, level, area and perimeter. For example, the room 206’s information of the selected residential building (Fig. 3.16, 3.17, 3.18, 3.19). Figure 3.16: Location of room 47 Figure 3.17: Name of room : Figure 3.18: Level of room 48 Figure 3.19: Area and perimeter of room 3.2 Programming All these five plugins were written using C# in Visual Studio following the workflow given previously. The five plug-ins are Tool 1: calculate the occupancy load for each room; Tool 2: determine and color code the fire exits; Tool 3: color code the fire rating of the walls; Tool 4: define which exit door should each room use (exit distribution) – this tool was not completed; and Tool 5: show the escape route plan (this was completed for a simple case). 3.2.1 Tool 1: Calculate the occupancy load for each room In Tool 1, an Excel table was used to help to reduce workload, optimize algorithms and reduce script file length. It must be emphasized that there are several other codes that are referenced by the IBC 2018, International Building Code 2018 is the latest version and The International Code Council (ICC) promulgates a new International Building Code every 3 years through the ICC Code Development Process. It is in use or adopted in all 50 states of the United States as well ("International Building Code [Latest Version] ICC IBC-2018 - ANSI Blog", 2020). According to 2018 International Building Code, Chapter 10 Means of Egress, Section 1004 Occupant Load, the first step to calculate the occupancy load is to search the specification table to find the per capita unit area of the specific building, and then divide the room area by the per capita area found in the table to get the occupancy load (ICC, 2020). How much space each 49 person takes up depends on the function of the room; the function of a space is decided by the designer or the owner of the building. The International Building Code specifies the maximum number of people in a building or space to ensure that there is enough space for people to move and escape in the event of a fire, provides minimum requirements for designing the Means of Egress system in all buildings and structures (ICC, 2020) . The occupant load factor is determined by function of a space or room (Fig. 3.20). Figure 3.20: Maximum floor are allowances per occupant Different methods should be applied when using “Net” and others “Gross” in the Chart. The net floor area is intended to include only the area of the room used for a specific purpose and does not include the areas such as corridors, stairways, ramps, toilet rooms, mechanical rooms and 50 closets. However, the gross floor area would include the area of all occupiable and non- occupiable spaces as mentioned in above, with the exception of exterior walls, vent shafts, and courts. The Section 1004.5 and Section 1004.6 respectively provide two methods of calculating occupant load (ICC), 2020). One is areas without fixed seating (Fig. 3.21) and another one is areas with fixed seating (Fig. 3.22). Figure 3.21: Occupant Load Calculation for Areas Without Fixed Seating In order to calculate the occupant load of a fixed seating area, the specification states that occupant load shall be determined by the number of fixed seating installed in the area or space. 51 Figure 3.22: Occupant Load Calculation for Areas with Fixed Seating For Tool 1, a dialog box pops up, it asks users to click the drop-down list in “Space Function”, it could be an agriculture building, airport terminal, business areas, residential, warehouse and so on. Occupancy load factors and formulas (from Table 1004.5) were preloaded into the Tool 1. Which means users do not need to know the load factor and formulas to calculate the occupancy load; Tool 1 can do this for users. However, if one were to write all these parameters and formulas in the C# script file, it will get overwhelming, since there are so many types in the space function. Therefore, Excel sheets were used to help the Tool 1 calculate (Fig. 3.23 and 3.24) 52 Figure 3.23: Occupant Load Without Fixed Seating Calculator in Excel 53 Figure 3.24: Occupant Load With Fixed Seating Calculator in Excel In the script file, data was written to an Excel file using C#. To achieve this, firstly, a reference was added to the dynamic link library for Excel, which is called Microsoft.Office.Interop.Excel.dll. This was done by going to the solution explorer and clicking on add a reference. Then, Microsoft.Office.Interop.Excel.dll was added (Fig. 3.25). Figure 3.25: Add a reference to the dynamic link library for Excel 54 For example, if the user selects “Airport terminal”, a new dialog box pops up that asks the user to click further on the options in the breakdown table, which are “Concourse,” “Waiting areas,” “Baggage claim,” “Baggage handling.” The user clicks these areas in the floor plan in Revit model one by one, Tool 1 automatically identifies the area and calculates the respective occupancy load then adds them up as the total occupant load. When the tool has completed the calculation, a schedule can be displayed in Revit. If any amendments are made to the code via ICC in the future, the Tool 1 could be updated. Currently, calculating the occupancy load for a room or space, for each occupancy type, was based on the formulas and tables in IBC 2018 (Table 3.1). Application Instructions Programming Language: C# Revit Platform: Architecture Type: ExternalCommand Summary: This Tool demonstrates how to get Room’s information (Number, Area, Department, etc.), and calculate occupant load automatically without referring to 2018 International Building Code, Chapter 10 Means of Egress, Section 1004 Occupant Load. Table 3.1: TOOL 1 - Calculate occupant load Input values How to obtain these values (Instructions) Pictures 55 Revit Room User creates some Walls and Rooms in Revit firstly (Define different Departments for Rooms) Occupancy Type User input occupancy type Area Tool 1 get room area from Revit automatic parameter. (Click the extern command, the Rooms Information form will be popped up) Intermediate values 56 Occupancy load of area Tool 1 calculate this Output Total occupancy load Tool 1 calculate this (Click “Export” button to export the Occupancy load summary to a .csv file.) 3.2.2 Tool 2: Color the fire exits In a Revit model, there is information about doors and walls such as their thermal characteristics, number of unique identifications, and fire resistance. This information can then be easily demonstrated and filtered by using filters for views within the model. When using Tool 2, data is entered into the model, such as room function parameters, whether the room function is a flow (such as lobby or corridor), and can be returned out to provide a specific exit type parameter value for each door (normal exit or emergency exit) (Table 3.2). And the door will be colored red in the Revit model if it is an emergency exit. There is a schedule of exit doors and locations could be exported also. 57 Application Instructions Programming Language: C# Revit Platform: Architecture Type: ExternalCommand Summary: This tool demonstrates how to figure out fire exit and normal exit and generate a door schedule with door type. Table 3.2: TOOL 2 –Color the Fire Exits Input values How to obtain these values (Instructions) Pictures Revit model with rooms and doors User creates some Walls and Rooms with doors in Revit firstly Room function parameters User inputs exit door. Intermediate values 58 Door egress type Tool 2 giving each door a specific value for “exit type” parameter Output Override door color Tool 2 override the projection line color of exit door elements. 3.2.3 Tool 3: Color code the fire rating of walls Tool 3 is to demonstrate fire rating by using color code overlay on the building elements. The user input the specific materials and modifies the standard family of annotations that are preloaded into the template. Tool 3 will add a label to represent the fire level, as defined in the property of the wall type set earlier (Fig. 3.26, Fig. 3.27). 59 Figure 3.26: Create a rule-based filter Figure 3.27: Colored walls with fire rating When filters are created, Tool 3 could be loaded into the Revit model. Fire ratings of walls and doors are displayed with fire rating tags in plan views. The elements on the plan view of the Revit model will change color when their values are modified for the FireRatingFilter (Table 3.3). 60 Application Instructions Programming Language: C# Revit Platform: Architecture Type: ExternalCommand Summary: This tool demonstrates how apply filters built in C# algorithms using a specific pattern to display fire ratings of walls in a plan view with different color filled, and this tool also automatically generate door tags displaying number and fire rating in a plan view. Table 3.3: Color code the fire rating of building elements Input values How to obtain these values (Instructions) Pictures Revit Room with walls and doors User creates some Walls and Rooms with doors in Revit firstly 61 Fire Ratings of walls and doors User input fire ratings in the type properties of walls and doors Filter with fire rating parameter Tool 3 get fire ratings from Revit parameter that user input. Tool 3 built a filter with fire rating parameter Output1 Plan view of walls with filter applied Filter was set inside the algorithms of Tool 3, a specific pattern was built inside Tool 3 as well, and it applied to the plan view with different colors. 62 Output2 (Future work) Door tags displaying number and fire rating Tool 3 generate door tags displaying number and fire rating automatically in a plan view. 3.2.4 Tool 4: Define which exit door should each room use (exit distribution) Exit doors and emergency doors are input in a Dialog box when using Tool 4, a filter to make sure “number of people < capacity” and “equal occupancy load” is created in this tool. There will be a plan view showing matched room and exit in Revit (Table 3.4). Application Instructions Programming Language: C# Revit Platform: Architecture Type: ExternalCommand Summary: This tool provides a software solution to address the exit distribution, calculate occupant per exit and check whether it is equal distribution, the tool highlights the unequal number as well. Table 3.4: TOOL 4 - Exit distribution (Define which exit door should each room use) Input values How to obtain these values (Instruction s) Pictures 63 Revit model with rooms and doors User creates some walls and rooms in Revit firstly Area Tool 4 get room area from Revit automatic parameter Intermedia te values Occupancy load of area Tool 1 calculate this Occupant per exit Tool 4 calculate the occupant per exit and determine whether it is equal or not Output Path of travel schedule Tool 4 fill the occupant number into occupancy schedule. If the occupant per exit is equal, display “Yes”, if not, display “no” and mark it red. 64 This tool was not completed. 3.2.5 Tool 5: Show the escape route plan A “Fire Exit Risk Assessment” is extremely important in an architectural BIM model, Tool 5 is to create evacuation plans for the building. In a lot of situations this is done manually based on estimations of the shortest and easiest way to reach an indicated “emergency exit.” The plugin could help to automate the definition of the shortest routes between a room exit and the nearest emergency exit. First, the plugin needs to detect the shortest route between a “normal” room exit door and one of the indicated emergency exit doors at ground level. Therefore, a room plan at that level is created and the rooms that can be used as “circulation”, which are the corridors or lobby. Detailed lines will be showed in Revit and a visual indicator displayed also. The evacuation routes for each room exit to the nearest emergency exit in Revit looks as follows: Figure 3.28: Egress Routes 65 Application Instructions Programming Language: C# Revit Platform: Architecture Type: ExternalCommand Summary: This tool provides a software solution that allows users to determine the maximum length of exit access travel, measured from the most remote point within a story to the entrance to a fire exit along the natural and unobstructed path of egress travel. Table 3.5: TOOL 5 - Show the escape route plan Input values How to obtain these values (Instructions) Pictures Revit model with rooms and doors User creates some walls and rooms in Revit firstly, furniture can be added selectively according to preference of users. Corner points of rooms Tool 5 find all the corner points of all the rooms Intermediate values Common path of travel distance (CPOTD lines) Tool 5 creating the path of travel from all room's corners to room doors 66 EATD: exit access travel distance Tool 5 creating the exit access travel distance includes the common path, all the way to the exit Output Path of travel calculation Tool 5 generate a dialog box to show schedule for each travel path and sum up common path of travel distance (CPOTD) and distance from regular door to fire exit, which is exit access travel distance (EATD lines) Notes: In the International Building Code (IBC) and real work, orthogonal lines are used as egress paths, diagonal lines are allowed to use sometimes under some special circumstances. Common Path of Travel distance (CPOTD) are usually used. Its definition is been explained in detail in Chapter 1 and 2. 67 Figure 3.29 Common Path of Travel (IBC 2018) 3.4 Summary Chapter 3 covers the entire workflow from platform set up, programming to validation. Five plug-ins were developed using C# based on International Building Code 2018; Chapter 4 has more details on the actual C# code. The development of BIM tools by adding plugin software to Revit to automate code checking for building is presented instead of manual checking of design code compliance. Tool 1: calculate the occupancy load for each room; Tool 2: color code and schedule the fire exits; Tool 3: color code the fire rating of building elements; Tool 4: define which exit door should each room use (exit distribution) (not done); and Tool 5: show the escape route plan (a simple version only was accomplished). A validation methodology was outlined to check if the tools are working properly. 68 Chapter 4: Tool Development For each tool, a description is given how to run the plugin, what the inputs are, and what the output is. Then each of the tool’s main scripts are explained. 4.1 Tool 1: Calculate occupant load Tool 1 demonstrates how to get Room’s information (Number, Area, Department, etc.), and calculate occupant load automatically without referring to 2018 International Building Code, Chapter 10 Means of Egress, Section 1004 Occupant Load. And automatically generate a schedule with occupancy load and other rooms information. 4.1.1 Tool instruction The user prepares a Revit model (Figure 4.1.1, Figure 4.1.2, Figure 4.1.3) with rooms and installs the add-in manager in Revit; the model can be a building with one use or an assembly building. The Revit model being tested is a three-story office building with 53 rooms. Figure 4.1.1 Revit floor plan 69 Figure 4.1.2 Revit 3D view Figure 4.1.3: Revit rendered view This assembly building is divided into classroom area, exercise room area, kitchen area, reading room area, vocational room area, and warehouse area. The user enters those occupancy type values in the Revit instance parameter Department for each individual room (Fig 4.1.4). 70 Figure 4.1.4: Input Occupancy Type After running Tool1, a room information form displays in Revit. Every column displays one parameter of each of the rooms, and the occupancy load for each is calculated automatically. As the form shows, this building has six different occupancy types, for “Classroom area,”, the total area is 15315 square feet and its total occupancy load of those rooms is 754 people (Fig. 4.1.5, Fig.4.1.6). 71 Figure 4.1.5 Room information form, page 1 72 Figure 4.1.6 Room information form, page 2 If the user clicks “Export to Excel” button, the form can be saved as an Excel file (Fig.4.1.7). Figure 4.1.7 Excel table 73 4.1.2 Tool 1 main scripts and its explanation A user interface is a visual entry interface that can be used to obtain information and allow users to interact with an application or website (Hannah, 2019). In the Window program development in Revit add-ins, there are basically two interfaces, Windows Form and WPF. In Tool 1, Windows Form was used because of its logical style and user friendliness. Firstly, one creates a new project in Visual Studio 2019 (Fig. 4.1.8). The project type is Windows Forms Application (.NET Framework). Figure 4.1.8 Create a new project Design a room information form UI and write codes as follow (Fig.4.1.9-Fig 4.1.13). The entire code is available in Appendix A. 74 Figure 4.1.9 Design room information form Figure 4.1.10 Design buttons for the room information form 75 Figure 4.1.11 Design room schedule 76 Figure 4.1.12 Design occupancy classification form 77 Figure 4.1.13 User interface of room information schedule The software finds the room data by iterating through the rooms in the project and retrieves the information of all the rooms (Fig 4.1.14). Then it stores the value of property area, Department name, and calculates the total occupancy of the rooms in Department. 78 Figure 4.1.14 Get room information The code then finds the property of rooms and departments by their name and parameter ID (Fig. 4.1.15). 79 Figure 4.1.15 Get property of rooms and department The it calculates the area of rooms for each occupancy type (Fig. 4.1.16). . 80 Figure 4.1.16 Calculate rooms’ area Then it saves and exports the data to an Excel file (Fig. 4.1.17). 81 Figure 4.1.17 Export to Excel Then it gets room data such as room name, room number, room area, occupancy type, level, room ID etc. and displays this room data in User Interface (Fig.4.1.18). 82 Figure 4.1.18 Display these room data in User Interface Then it calculates the value of occupancy load based on International Building Code 2018 (Figure 4.1.19). 83 Figure 4.1.19 Calculate occupancy load Finally, it displays the total rooms’ information for each occupancy type and saves it into an Excel file (Fig.4.1.20). 84 Figure 4.1.20 Display total rooms’ information When the project runs successfully, the compiled DLL file path can be copied to Revit. After loading and running this add-in, a Windows Form interface shows in Revit (Figure 4.1.21). 85 Figure 4.1.21 Windows Form interface 4.2 Tool 2: Color the Fire Exits Tool 2 automatically colors the fire exit as red, which is achieved by using the override projection line color of exit door in a plan view. For the future work in Tool 2, it will automatically generate a schedule of the fire exits. 4.5.2 Tool instruction The user prepares a Revit model with rooms and doors including setting the door type of element for fire exit as “exit” in type parameter value of Revit (Figure 4.2.1). When Tool 2 is run, the exit doors in the plan view are colored red (Figure 4.2.2). 86 Figure 4.2.1 Revit plan view test for Tool 2 Figure 4.2.2 Plan view of colored exit doors when running Tool2 87 4.2.2 Tool 2 main scripts and its explanation Tool 2 gets the element ID of exit door, then generates a method to override the graphic setting and sets the projection line color as a fixed value, applies the element ID to the method, then the color of exit door can be override as a new color that is different with the normal doors. Figure 4.2.3 Main scripts of Tool 2 4.3 Tool 3: Color code the fire rating of walls Tool 3 visual shows the fire rating of a wall in plan by using color code overlay on the walls in Revit. Walls with different fire ratings show different colors in the plan view. The user inputs the fire rating parameter of each wall and modifies the standard family of annotations that are preloaded into the template. Future work is to create a schedule of the walls with each of the color codes explained. 88 4.3.1 Tool instruction Users prepare a Revit model with rooms and doors (Figure 4.3.1), predetermine the fire rating value for each wall, and input that value in “Fire rating” parameter in type property. For example, “30min” “1hr” fire rated walls are used in this model. Walls with no fire code assigned are show in in the default color. A limitation is that the code does not first determine all the fire codes used, assign them colors, and have a legend of these colors. Figure 4.3.1 Revit model in a Plan View 89 Figure 4.3.2 Input fire rating value Run Tool 3, an active plan view shows the colored walls (Figure 4.3.3). Figure 4.3.3 Plan view of colored walls when running Tool3 90 4.3.2 Tool 3 main scripts and its explanation The code first filters all the walls in a plan view, retrieves the element’s type among the collector, then iterates over the type parameters to locate the Fire Rating value and checks if it matches one of the enumerated values. If matched, it executes the method that overrides graphic settings and changes the cutline color of wall according to its fire rating value; the material of walls can be changed as well if needed (Figure 4.3.4). If the value that user inputs doesn’t match any predetermined value, then it collects its Element Id and keeps that wall its default black color. In scripts, if Tool 3 read the fire rating value as “30min”, the cutline of this wall element will be override to red (RGB value is 200-100-100); if the fire rating parameter is “1hr”, the cutline of this wall element will be override to yellow (RGB value is 210-180-100); if the fire rating value set to be “2hr”, then the cutline of this wall element will be override to light blue (RGB value is 000-250-250) (Figure 4.3.5). 91 Figure 4.3.4 Main scripts of Tool 3 Figure 4.3.5 Color fill Legend 92 4.4 Tool 4 (Future work): Define which exit door should each room use (exit distribution) Tool 4 provides a software solution to address the exit distribution, calculate occupant per exit and check whether it is equal distribution, the tool highlights the unequal number as well. This was not accomplished. 4.5 Tool 5: Show the escape route plan Tool 5 finds the most remote corner point in every room and generate CPOTD lines (common path of travel distance) and EATD lines (exit access travel distance) and calculates their length automatically. A few current limitations: users must specify the exit door to the building; only the corner points of the room as used to check for most distance point from the door; the path is not orthogonal (made of perpendicular straight lines). Future work is to fix these issues and also schedule the escape route data on a Revit sheet. 4.5.1 Tool instruction Users prepare a Revit model with rooms and a door; furniture can be added selectively according to preference of users as well. The testing model has one room and a hallway to the outside (Figure 4.5.1). 93 Figure 4.5.1 Revit model with one room When running Tool 5, the user interface form (Figure 4.5.2) pops up to allow users to select an option to create path of travel lines. Figure 4.5.2 Tool 5 user interface If the user selects “All room corners to all doors” command then clicks “ok” button, Tool 5 creates the path of travel from all room's corners to all doors and also creating the path of travel from all room's corners to all doors (Figure 4.5.3). 94 Figure 4.5.3 Tool 5 result using “All room corners to all doors” command If the user selects “Single room corners to single doors” command then clicks “OK” button, Tool 5 creating the path of travel from the user selected room's corners to the target door that user selected as well. Users need follow the instruction (Figure 4.5.4, Figure 4.5.5) on the lower left corner in Revit. 95 Figure 4.5.4, 4.5.5 Tips on the lower left corner in Revit (select a room, select a target door) Tool 5 generate path of travel in EATD lines (Figure 4.5.6) and CPOTD lines (Figure 4.5.7). Figure 4.5.6 EATD lines with one room model 96 Figure 4.5.7 CPOTD lines with one room model Tool 5 generates a dialog box (Figure 4.5.8) to show schedule for each travel path and sums up common path of travel distance (CPOTD) and distance from regular door to fire exit, which is exit access travel distance (EATD lines). Figure 4.5.8 Tool 5 dialog box 97 Tool 5 also works in a building with multiple rooms if users click command “All room corners to selected exit door” and follow the tips in the lower left corner of Revit to select exit door (Figure 4.5.9). Figure 4.5.9 Tool 5 user interface The results show as Figure 4.5.10, the path of travel lines all start from farthest room corner to exit door, which are Exit Access Travel Distance (EATD), their information such as “length,” “level,” “start point and end point,” and “evacuating time” could be found in the Revit instance parameter dialogue box (Figure 4.5.11). EATD lines automatically avoid furniture in rooms; therefore, the layout of furniture will affect the length of evacuation path. If the code does not care about furniture, turn it off in Revit in the Visibility Graphics … Overrides before running Tool 5. 98 Figure 4.5.10 Screenshot when running Tool 5 in multiple rooms building Figure 4.5.11 Information about path of travel line 4.5.2 Tool 5 main scripts and its explanation This part of the code creates a filter to select all door elements and a filter to select all room elements (Figure 4.5.12). 99 Figure 4.5.12 Make a selection filter It collects all the door’s origin points on the active level of floor plan (Figure 4.5.13). 100 Figure 4.5.13 Iterate doors and collect the door’s origin points Then it finds the most remote points in every room from the near corner points list, which are points offset from the room boundaries by 1.5 feet (Figure 4.5.14). 101 Figure 4.5.14 Find the most remote points in every room It then generates the path of travel from start points to end points (Figure 4.5.15). 102 Figure 4.5.15 Map all source points 4.6 Summary Chapter 4 covers the main scripts and their explanations, gives a few of the limitations of the tool, and has instructions to show the user how to use the tool. Tool 1: calculates the occupancy load for each room; Tool 2: color codes the fire exits; Tool 3: color code the fire rating of walls; Tool 4: defines which exit door should each room use (exit distribution) (not done); and Tool 5: shows the escape route plan using the corners of the room as the “furthest point.” Chapter 5 will describe validations for each of these tools. 103 Chapter 5: Validation Each tool was validated against a known correct solution. The validation stage is used to ensure that the tools provide accurate results. Five tools were designed to help engineers and architects save time and reduce workload. There are many ways to validate these tools. In order to validate the correctness of the software results, this chapter uses different methods to calculate or verify accuracy. In addition, the users can run these tools again to check if the design is met with the building code without any errors. 5.1 Tool 1: Calculate the occupancy load for each room There is another way to calculate the occupant load in Revit; it was used to validate Tool 1. The occupancy load factors and formulas were preloaded into the Excel table (Figure 5.1.1). The areas of the room were entered into the yellow block, and a result obtained of occupant load of this area. Then the occupant load values were added together. After doing this, it was shown that the result of total occupancy load (Figure 5.1.2) is exactly same as what Tool 1 calculates (Figure 5.1.3). 104 Figure 5.1.1 Floor plan and Excel calculator for occupancy Figure 5.1.2: Results calculated by hand 105 Figure 5.1.3 Results calculated by Tool 1 5.2 Tool 2: Color the Fire Exits Tool 2 overrides the color of exit door; Figure 5.2.1 shows the plan view before running Tool 2, Figure 5.2.3 shows the plan view after applying Tool 2. All the exit doors are tagged as “E” in “Mark” value of door schedule, seen from figure 5.2.2, the projection line of all the exit doors are override to red. 106 Figure 5.2.1 Plan view before running Tool 2 Figure 5.2.2 Plan view after running Tool 2 Four of the doors are colored red. To check that this is correct, the same Revit file was used. A door schedule was created. The “Mark” for the exterior doors is “E.” The doors that are marked with E are the four red doors (Figure 5.2.3). 107 Figure 5.2.3 Sheet with door schedule and plan view 5.3 Tool 3: Color code the fire rating of walls The user set the wall type fire Rating as “30min” in Revit and printed out the result that Tool 3 generated. Tool 3 reads the correct value as set in Revit (Figure 5.3.1). Then the validator changed the Wall type fire Rating to “1hr” in Revit; Tool 3 reads and shows the correct value, and the wall color changed as well (Figure 5.3.1). Figure 5.3.2 shows a legend of what the different colors stand for and the RGB value of each color. Figure 5.3.1 Result of Tool 3 when setting the fire rating value as “30min” and “1 hr” and nothing in the type parameter 108 Figure 5.3.2 Color fill legend (created manually) Another test model has a floor plan with 5 types of walls. Wall type 1 and wall type 2 was not be assigned a fire rating value. Wall 3 fire rating value was set to “30min”, wall 4 to “2hr”, and wall 5 to “1hr” in the fire rating parameter of wall schedule. As the result shows in Figure 5.3.3, the cutline color of wall 3 changed to red, wall 4 changed to light blue, and wall 5 changed to yellow; other walls that do not have a fire rating remained default black. The results generated by Tool 3 match these colors. Figure 5.3.3 Sheet with wall schedule and plan view 109 5.4 Tool 4 (Future work): Define which exit door each occupant in each room should use (exit distribution). This work has not been done yet. 5.5 Tool 5: Show the escape route plan Tool 5 calculates the escape distance. In order to validate it, a simple floor pan was created. In Revit, the “Path of Travel” command was used calculated as the shortest travel distance between the 2 selected points avoiding model element obstacles in the path of travel. As Figure 5.5.2 shows, four lines was generated, starts from four points to end points of exit door. Length of line1 is 74 feet (Figure 5.5.3), length of line2 is 95 feet (Figure 5.5.3), length of line3 84 feet (Figure 5.5.4), length of line5 is 54 feet (Figure 5.5.4). Obviously, point at the top right corner is the farthest point in the room. Tool 5 picks this point. Figure 5.5.1 “Path of Travel” command Figure 5.5.2 Corner points in the room 110 Figure 5.5.3 Line 1 (left), line 2 (right) Figure 5.5.5 Line 3 (left), line 4 (right) Tool 5 picked the top right corner point as well (Figure 5.5.5 – right and Figure 5.5.6). The length of lines generated by Tool 5 is 96 feet, the length from Point 2 to the exit door drawn by Revit “path of travel command” is 95 feet. Since the Point 2 is the corner point roughly picked by hand, there will be some deviation using Revit command. In all, they match the other method used. 111 Figure 5.5.6 Tool 5 results 5.6 Summary Chapter 5 shows the validation of four of the five tools, Tool4 was not done; the other tools give accurate results within the scope of each of the tool’s functionality. Tool 1: calculate the occupancy load for each room; Tool 2: color code the fire exits; Tool 3: color code the fire rating of walls; Tool 4: define which exit door should each room use (exit distribution) (not done); and Tool 5: show the escape route plan. The Revit plug-ins, within the limitations that were described about them, gave the correct values. 112 Chapter 6: Conclusion, Discussion, and Future Work The five plugins follow the International Building Codes which architects and engineers can refer to when designing buildings, for the purpose of creating a safe environment for building occupants. Combined with the building information model, automation of fire code compliance is integrated by the use of Revit plugins; these plugins are able to provide user interfaces to users to add building information to the BIM, such as occupancy type, fire ratings, and egress path. Building code compliance check is a fairly repetitive and tedious work, which requires people in the whole process of design and construction of project monitoring and maintenance. In the traditional architectural design method based on the conventional CAD model of compliance check, there is a lot of manual intervention and explanations that makes the inspection process of the specification tedious and time-consuming. The purpose of the thesis is making tools doing some repetitive work and improving the work efficiency of users. 6.1 Context Chapter 1 gives an overview of building information modeling (BIM), the Revit API, fire code compliance, and indicators such as occupancy load, fire exit, fire ratings and exit routes are explained. The fire code used as a reference is a basic standard to regulate the construction of buildings. Occupancy load is used to describe the number of people that is allowed in a building at one time according to its floor area and function (IBC, 2018). Determining the total occupancy load of the building is an important part in making sure whether the building conforms to the basic concept of building codes that is designed to accommodate all the occupants of the building (Boutin, 2020). Fire exits are exits which are separated within the building or isolated in some way and are less likely to catch fire or fill with smoke as easily as the main body of the building and allow people to escape easier (NFPA, 2019). Fire ratings for wall means the period 113 of time that a wall element is able to confine a fire and continue to provide the structural functions. An exit route is a continuous and unimpeded path of exit travel from any point in a building to safety outside (IBC 2018). It is calculated in two parts, they are access to the exit, and the way from the building to the public way. Chapter 2 gives a background research about building information modeling, Revit plug-ins examples, and fire software program examples. It also includes information from an interview with a fire professional engineer. Revit was chosen because its platform allows users customize or extend corresponding functions on the Revit platform in the way of programming development. A Revit plug-in is a software used is Revit to automate repetitive tasks and extend the core functionality of Revit, It is developed with C# language in the thesis. Based on the background research and interview, it was decided to create five plugins: Tool 1: calculate the occupancy load for each room; Tool 2: color code the fire exits; Tool 3: color code the fire rating of walls; Tool 4: define which exit door should each room use (exit distribution) (not done); and Tool 5: show the escape route plan. Chapter 3 covers the entire workflow from platform set up, programming to validation. The International Building Code 2018 was used as a reference. The overall methodology to accomplish this has three main parts: preparation (platform setup), programming, and validation (Figures 6.1.1, 6.1.2, 6.1.3). 114 Figure 6.1.1 Entire methodology diagram Figure 6.1.2 Methodology diagram part 1 115 Figure 6.3 Methodology diagram part 2 Chapter 4 has more details on the actual C# code. The development of BIM tools by adding plugin software to Revit to automate code checking for building is presented instead of manual checking of design code compliance. The validation in Chapter 5 shows that all the tools work within the limits of their design. Four of the five plug-ins were successful written. The next five sections explained what each of them do, current limitations, and future work for improving the tool as more features can be added to each one, and algorithms can be optimized. 116 6.2 Tool 1 Tool 1 calculates the occupancy load for each room (see chapter 4.1 for details) (Fig. 6.2.1). Figure 6.2.1 Final output of Tool 1 6.2.1 Current Limitations of Tool 1 There are two current limitations for Tool 1: user input and not all occupancy types are listed in the tool. 1. Users are required to input the exact name of occupancy type in the Revit instance parameter Department for each individual room (Fig 6.2.2). If wrong words are input in department parameter, the result of occupant load would be calculated as zero in this room, if users forget to assign a occupant type to a room or space, the result of occupant load in this room or space would be zero as well. 117 Figure 6.2.2 Input Occupancy Type A better solution might be creating a drop-down list that users can select from it, so that users do not need to type the occupant type by themselves. 2. Another limitation is that not all occupancy types are listed in the algorithms. To fix that, all the occupant types and their corresponding floor area per occupant should be written into the scripts. 6.2.2 Future Work Tool 1 First fix all the current limitations. There are three more significant improvements that could be accomplished: occupancy type can be set as a separate instance, the schedule generated by Tool1 will be allowed to make changes by users, and “Import from Excel” command could be added. 1. An occupancy type will be set as a separate instance parameter in the properties panel (Figure 6.2.3), users do not need to input this value in “Department” anymore. The occupancy type instance may be placed under the “other” column as a custom value. 118 Figure 6.2.3 Properties panel 2. The schedule will be allowed to make changes by users, more columns can be added or deleted based on the needs of users. For example, users can delete the level of rooms and add other information to this schedule (Fig. 6.2.4). 119 Figure 6.2.4 Room information schedule generated by Tool 1 3. Currently, the Tool 1 has the command “Export to Excel” (Figure 6.2.5). There could be a command to import from Excel as well. Sometimes users change the data in an Excel table that was exported from Tool 1, and they need the value changes in Revit model correspondingly. Therefore, an “Import from Excel” command would be helpful. 120 Figure 6.2.5 Excel exported from Tool 1 6.3 Tool 2 Tool 2 color codes the fire exits (see chapter 4.2 for details) (Fig. 6.3.1). Figure 6.3.1 Plan view of colored exit doors after running Tool 2 6.3.1 Current Limitations of Tool 2 The one major limitation of Tool 2 is that users have to manual input in Revit which door is an exterior door. Users have to modify the function of doors as “Exterior” or “Interior” in Revit type parameter or door schedule (Figure 6.3.2). Tool 2 automatically color the projection line of exterior door as red. But sometimes, an exterior door is not necessarily a fire exit door. 121 Figure 6.3.2 Door schedule A better solution might be to create a new instance parameter named “Door egress type” in the properties panel of the door (Figure 6.3.3). Users can choose the egress type of the door as “Is egress door” or “Not egress door.” Then Tool 2 would color red the doors with “Is egress door” parameter. 122 Figure 6.3.3 “Door egress type” parameter 6.3.2 Tool 2 Future Work First fix all the current limitations. There are four improvements that could also be done: automatically tag the egress door; generate a door schedule in Tool 2; allowed to export the schedule to Excel, and automatically determine which door is an exit door. 1. Tool 2 would color red the doors with “Is egress door” parameter and auto tag the egress type to assigned doors (Figure 6.3.3). Figure 6.3.4 Auto tag egress doors only 2. A door schedule (Figure 6.3.5) with egress type could be generated automatically in Revit and placed on a sheet (Figure 6.3.6) with the floor plan. 123 Figure 6.3.5 Door Schedule 124 Figure 6.3.6 Sheet with door schedule and floor plan 3. Users can choose to export the schedule as an Excel file. This is useful because data in Excel are easily to make changes and calculation. 4. A more difficult solution would be for the script to determine what the exit doors are according to the building code. Since exit doors must be kept hinged on the side and unlocked on the inside, free of alarms as well. Typically, a building should be equipped with two exit doors in case one of them is blocked, the two exits have to be as far apart as practicality allows depending on the size of building and the number of occupants (NFPA, 2019). The number of exits is determined by the designed occupancy load. Each story should be equipped with the minimum number of independent exits, as specified in IBC, chapter 1006 "Number of Exits and 125 Exit Access Doorways" (Figure 6.3.7), and these required number of exits should provide access to exits. As a result, it is complicated to determine automatically which door is an exit door because one cannot tell if it is an exit door by a single condition. Figure 6.3.7 Minimum number of exits per story based on occupant load (IBC, 2018) 6.4 Tool 3 Tool 3 color codes the floor plan based on the fire rating of walls (see chapter 4.3 for details) (Fig. 6.4.1) 126 Figure 6.4.1 Plan view of colored walls after running Tool 3 6.4.1 Current Limitations of Tool 3 There are three major limitations for Tool 3: Revit crashing, missing automatic tagging of walls, and not generating a color legend of the fire codes automatically. 1. When running a complicated model with too many walls in Tool 3, Revit runs slowly, sometimes Revit would shut down or fail to respond. The reason for this is that the Tool 3 needs to go through all the wall elements and find the fire rating value for each wall, then override the cutline of these walls with different colors. This is a limitation that cannot be avoided now. 2. Fire rating values could be tagged next to the walls automatically. 3. There is no pre-set values for walls with fire rating are not “30min,” “1hr,” “2hr.” To fix this limitation the code could add more color with more fire ratings to the existing pattern. Currently three fire rating values are pre-set in the algorithms. The code could determine all the values that the user entered and use those. In addition, fire rating values could be tagged besides the walls. A 127 color legend should be generated for all the colors that are assigned to the walls by the user (Figure 6.4.1). Figure 6.2.3 Color pattern 6.4.2 Future Work for Tool 3 First fix all the current limitations. There are two more significant improvements that could be accomplished: generating a wall schedule automatically with a color legend and placing it on a Revit sheet and have Revit mark walls that do not seem to have the correct fire rating according to code. 1. A wall schedule with fire rating values could be generated automatically in Tool 3 with a color legend and placed on a Revit sheet (Fig. 6.4.1). 128 Figure 6.4.1 Revit sheet 2. A more difficult improvement would be for Revit to highlight walls that do not seem to have the correct fire rating according to code. 3. Sometimes users have to define different types of wall such as Fire Barrier versus Fire Partition versus Smoke Barrier, etc. In future work, users are able to add text abbreviations to the walls to differentiate the types. 6.5 Tool 4 (not completed) Tool 4 was to provide a software solution to address the exit distribution, calculate occupant per exit and check whether it is equal or unequal distribution. 129 Figure 6.4.1 Exit distribution plan 6.6 Tool 5 Tool 5 shows the escape route plan, and travel line distances are put in the Revit instance parameter of the path (see chapter 4.5 for details) (Fig 6.6.1). 130 Figure 6.6.1 Result of running Tool 5 6.6.1 Current Limitations of Tool 5 There are six major limitations for Tool 5: finding the furthest point in non-rectangular shaped floor plans; , determining what door is an exit door; find the shortest path from the normal doors’ origin points to those egress doors; the corner points may not be the furthest point in a room; a schedule of path of travel lines with start points and endpoints cannot be generated automatically in Tool 5. 1. Algorithms in Tool5 have some defects in finding all the corner points in rooms if the room shape is not a rectangular, for example, Tool 5 cannot find the right points in non-rectangular shaped floor plans. To fix this limitation or a better solution might be rewriting the algorithms to find the farthest points in rooms, not just find most remote points from the corner points list. 2. In Tool 5, currently users need to select exit door, then Tool 5 generate path of travel lines from farthest corner points to the selected exit door. A better solution might be let users preset all the egress type of the doors in Revit model and update the algorithms to read that value from users’ input. 131 3. Currently, Tool 5 cannot find the shortest path from the normal doors’ origin points to those egress doors. To fix this limitation one could add a filter to the algorithms, so that Tool 5 only generate the shortest path from interior doors to an exit door. 4. The corner points may not be the furthest point in a room in the case of some special furniture placement, which means any point in the room could be the farthest point, therefore, every point has to be checked. In Tool5, these cases will not be considered currently. A better solution might be to check all the points in rooms to find the point with longest path to the room door. 5. A schedule of path of travel lines with start points and endpoints could be generated automatically in Tool 5 (Figure 6.6.1). Figure 6.6.1 Path of travel lines schedule 6. The software could create a Revit sheet showing the final path of travel lines and their lengths (Figure 6.6.2). 132 Figure 6.6.2 Travel distance and length 6.6.2 Future Work for Tool 5 First fix all the current limitations. There are three more significant improvements that could be accomplished: work in non-standard rooms, be able to choose between straight and orthogonal paths, and work for more complex floor plans. 1. Algorithms should be improved to work in non-standard rooms (Figure 6.6.3). 133 Figure 6.6.3 Example of irregular shaped rooms 2. Users should be able to choose between diagonal and orthogonal path creation depending on the exact requirements of their fire code (Figure 6.6.4). Figure 6.6.4 User interface of options to create path of travel (left); Exit path with orthogonal lines (right) 3. The final goal would be able to work with more complex floor plans and format the information in the manner prescribed by the fire codes. Paths of travel might have both diagonal and orthogonal lines depending on the code, the use of the rooms, and the direction of the hallway, and the location of the fire exits. (Fig. 6.6.5). 134 Figure 6.6.5 Very small part of an exit plan for an airport. 6.7 Other Future Work More functions can be added in all these tools. For example, a Ribbon panel in Revit could be designed to integrate these tools, each push button and pulldown button stands for a separate command (Fig. 6.7.1). Figure 6.7.1 Example of Ribbon panel (Autodesk, 2014) It is important to optimize the user interface for each of the tools in order to improve the user experience. In addition, there will be an extension of automated checking process with other aspects of the building fire codes for developing a complete automated building rules checking process. 6.3 Summary 135 Revit as a powerful platform, it provides an application programming interface (API) for external programs to manipulate and access which allows users to develop their own customized plug-in tools to including automating repetitive tasks or automatically check specification detection errors. Five BIM aided plugins were developed in Revit using C# programming language and based on International Building Code 2018 (IBC 2018) to assist and check building fire protection design. Tool 1 automatically calculates occupancy load for each room based on the occupant types and area; Tool 2 color the exit doors red; Tool 3 override the cutline of walls in different colors based on their fire rating values; Tool 4 defines which escape doors the room occupants should use (not completed); and Tool 5 generate evacuation lines. These plugins are designed to improve the efficiency of people working in related industries and avoid doing repetitive tasks, although these tools still have some drawbacks and they are still far from complete software. For the future work, algorithms will be optimized to improve the efficiency of plug-ins as more functions can be designed and applied to fire code automation. Furthermore, tools that automating other parts of the building code such as accessible design can be integrated as well. It will come very useful to not only automatically produce documentation that describes code compliance, but also be able to code check buildings with less manual labor. 136 References Aydın, M. (2020). A Literature Review of Automated Code Compliance Checking Concept. Tasarım + Kuram. doi: 10.14744/tasarimkuram.2020.86158 Cerovsek, T. (2011). A review and outlook for a ‘Building Information Model’(BIM): A multi- standpoint framework for technological development. Advanced engineering informatics, 25(2), 224-244. Chen, N., Kan, F., Wang, X., Wang, C., Qi, N., Liu, X., ... & Wang, B. (2016, January). Research on the Secondary Development of Revit Software. In International Conference on Education, Management, Computer and Society. Atlantis Press. Fire Engineering and Vertical Evacuations In Ultra High-Rise Buildings (2015 MBS thesis by Angella Johnson) Fire Protection & Code Consulting | Building Solutions | Buildings | Services | Burns & McDonnell. (2020). Retrieved 24 June 2020, from https://www.burnsmcd.com/services/buildings/building-solutions/fire-protection-code- consulting Harrell, R., & Mathews, M. (2018). Could Autodesk Revit Be Automated for Code Compliance Checking and Demonstration with A Focus on Fire Safety Regulations?. Khan, N., Ali, A., Van-Tien Tran, S., Lee, D., & Park, C. (2020). Visual Language-Aided Construction Fire Safety Planning Approach in Building Information Modeling. Applied Sciences, 10(5), 1704. doi: 10.3390/app10051704 137 Kincelova, K., Boton, C., Blanchet, P., & Dagenais, C. (2020). Fire Safety in Tall Timber Building: A BIM-Based Automated Code-Checking Approach. Buildings, 10(7), 121. doi: 10.3390/buildings10070121 Lee, H., Lee, J. K., Park, S., & Kim, I. (2016). Translating building legislation into a computer- executable format for evaluating building permit requirements. Automation in Construction, 71, 49-61. https://doi.org/10.1016/j.autcon.2016.04.008 Lee, P. C., Lo, T. P., Tian, M. Y., & Long, D. (2019). An efficient design support system based on automatic rule checking and case-based reasoning. KSCE Journal of Civil Engineering, 23(5), 1952-1962. Preidel C, Borrmann A (2016). Towards code compliance checking on the basis of a visual programming language, ITcon Vol. 21, Special issue CIB W78 2015 Special track on Compliance Checking, pg. 402-421, https://www.itcon.org/2016/25 Temel, B., & Başağa, H. (2020). Investigation of IFC file format for BIM based automated code compliance checking. Journal Of Construction Engineering, Management & Innovation, 3(2), 113-130. doi: 10.31462/jcemi.2020.02113130 Wang, S. H., Wang, W. C., Wang, K. C., & Shih, S. Y. (2015). Applying building information modeling to support fire safety management. Automation in construction, 59, 158-167. Zhang, S., Teizer, J., Lee, J., Eastman, C., & Venugopal, M. (2013). Building Information Modeling (BIM) and Safety: Automatic Safety Checking of Construction Models and Schedules. Automation In Construction, 29, 183-195. doi: 10.1016/j.autcon.2012.05.006 138 Banfi, F. (2019). The integration of a scan-To-hbim process in bim application: The development of an add-in to guide users in autodesk revit. In 2nd International Conference of Geomatics and Restoration, GEORES 2019 (Vol. 42, No. 2, pp. 141-148). Copernicus GmbH. Ingram, J. (2020). Understanding BIM: The Past, Present and Future. In Understanding BIM. CRC Press. https://doi.org/10.1201/9780429282300 Baldwin, M. (2019). The BIM-Manager: A Practical Guide for BIM Project Management. Beuth Verlag GmbH. (ICC), I., 2020. IBC2018P4 - CHAPTER 10. [online] Codes.iccsafe.org. Available at: <https://codes.iccsafe.org/content/IBC2018P4/chapter-10-means-of- egress#IBC2018P4_Ch10_Sec1004> [Accessed 28 September 2020]. International Building Code [Latest Version] ICC IBC-2018 - ANSI Blog. The ANSI Blog. (2020). Retrieved 7 October 2020, from https://blog.ansi.org/2017/11/2018-international- building-code-icc-ibc/#gref. Clayton, M. (2013). Automated Plan Review for Building Code Compliance Using BIM [Conference paper]. Grimm, T. (2017). HydraCAD – Fire Protection Systems Design in Revit - Revit news. Revit news. Retrieved 9 November 2020, from https://www.revit.news/2017/05/hydracad-fire- protection-systems-design-in-revit/. Harrington, J. (2020). Fire Dynamics Simulator (FDS) and Smokeview (SMV) – Bringing Fire Analysis to Life – Harrington Group. Hgi-fire.com. Retrieved 9 November 2020, from 139 https://hgi-fire.com/blog/fire-dynamics-simulator-fds-and-smokeview-smv-bringing-fire- analysis-to-life/. Nelson, T. Instant Autodesk AutoCAD 2014 customization with .NET. Rüppel, U., Stübbe, K. M., & Zwinger, U. (2010, September). Indoor navigation integration platform for firefighting purposes. In 2010 International Conference on Indoor Positioning and Indoor Navigation (pp. 1-6). IEEE. Nguyen, T. H., & Kim, J. L. (2011, December). Building code compliance checking using BIM technology. In Proceedings of the 2011 Winter Simulation Conference (WSC) (pp. 3395- 3400). IEEE. Jin, Z., & Gambatese, J. (2019, June). Bim for temporary structures: Development of a revit api plug-in for concrete formwork. In Proceedings of the CSCE Annual Conference Growing with Youth, Laval, QC, Canada (pp. 12-15). BIM and fire protection engineering. (2020). Retrieved 25 June 2020, from https://www.csemag.com/articles/bim-and-fire-protection-engineering/ BIM and fire protection engineering. (2020). Retrieved 25 June 2020, from https://www.csemag.com/articles/bim-and-fire-protection-engineering/ 140 Appendix A Change element color using Autodesk.Revit.Attributes; using Autodesk.Revit.DB; using Autodesk.Revit.UI; using Autodesk.Revit.UI.Selection; using System; using System.Collections.Generic; using System.Linq; namespace FireRating { [Transaction(TransactionMode.Manual)] [Regeneration(RegenerationOption.Manual)] public class CmdChangeElementColor : IExternalCommand { public Result Execute(ExternalCommandData commandData, ref string messages, ElementSet elements) { UIDocument uidoc = commandData.Application.ActiveUIDocument; Document doc = uidoc.Document; //ElementId id = uidoc.Selection.PickObject(ObjectType.Element, "Select an element").ElementId; //filter all walls //FilteredElementCollector col = new FilteredElementCollector(doc); //col.OfCategory(BuiltInCategory.OST_Walls); FilteredElementCollector a = new FilteredElementCollector(doc).OfClass(typeof(Wall)); foreach (Wall wall in a) { Parameter par_Rating = wall.WallType.get_Parameter(BuiltInParameter.DOOR_FIRE_RATING); //TaskDialog.Show("Wall type fire rating", par_Rating.AsString()); //Parameter par_Rating = wall.WallType.get_Parameter(BuiltInParameter.DOOR_FIRE_RATING); if (par_Rating.AsString() != null) { if (par_Rating.AsString().Equals("30min")) { ElementId id = wall.Id; Element e = doc.GetElement(id); OverrideGraphicSettings ogs = new OverrideGraphicSettings(); 141 ogs.SetCutLineColor(new Color(200, 100, 100)); using (Transaction t = new Transaction(doc, "Set Element Override")) { t.Start(); doc.ActiveView.SetElementOverrides(id, ogs); t.Commit(); } if (null != e.Category) { int im = e.Category.Material.Id.IntegerValue; List<Material> materials = new List<Material>( new FilteredElementCollector(doc) .WhereElementIsNotElementType() .OfClass(typeof(Material)) .ToElements() .Where<Element>(m => m.Id.IntegerValue != im) .Cast<Material>()); Random r = new Random(); int i = r.Next(materials.Count); using (Transaction t = new Transaction(doc)) { t.Start("Change Element Material"); e.Category.Material = materials[i]; t.Commit(); } } } else if (par_Rating.AsString().Equals("1hr")) { ElementId id = wall.Id; Element e = doc.GetElement(id); OverrideGraphicSettings ogs = new OverrideGraphicSettings(); ogs.SetCutLineColor(new Color(210, 180, 100)); using (Transaction t = new Transaction(doc, "Set Element Override")) { t.Start(); doc.ActiveView.SetElementOverrides(id, ogs); t.Commit(); } 142 } else if (wall.WallType.get_Parameter(BuiltInParameter.DOOR_FIRE_RATING).AsString().Equals("2 hr")) { ElementId id = wall.Id; Element e = doc.GetElement(id); OverrideGraphicSettings ogs = new OverrideGraphicSettings(); ogs.SetCutLineColor(new Color(0, 250, 250)); using (Transaction t = new Transaction(doc, "Set Element Override")) { t.Start(); doc.ActiveView.SetElementOverrides(id, ogs); t.Commit(); } } else if (wall.WallType.get_Parameter(BuiltInParameter.DOOR_FIRE_RATING).AsString().Equals("") ) { ElementId id = wall.Id; Element e = doc.GetElement(id); OverrideGraphicSettings ogs = new OverrideGraphicSettings(); ogs.SetCutLineColor(new Color(0, 0, 0)); using (Transaction t = new Transaction(doc, "Set Element Override")) { t.Start(); doc.ActiveView.SetElementOverrides(id, ogs); t.Commit(); } } if (wall == null) return Result.Failed; //Parameter par_Rating = wallType.get_Parameter(BuiltInParameter.DOOR_FIRE_RATING); //TaskDialog.Show("Wall type fire rating", par_Rating.AsString()); } } return Result.Succeeded; } } } Calculate occupant load form 143 using System; using System.Data; using System.Collections.ObjectModel; using System.Windows.Forms; using Autodesk.Revit; using Autodesk.Revit.DB; using Autodesk.Revit.DB.Architecture; using System.Diagnostics; namespace CalculateOccupanctLoad_Form { public partial class roomsInformationForm : System.Windows.Forms.Form { RoomsData m_data; // Room's data for current active document public roomsInformationForm() { InitializeComponent(); } public roomsInformationForm(RoomsData data) { m_data = data; InitializeComponent(); } private void DisplayRooms(ReadOnlyCollection<Room> roomList, bool isHaveTag) { String propertyValue = null; //value of department String departmentName = null; //department name Double areaValue = 0.0; //room area int occupancyValue = 0; // room occupancy int AreaPerOccupant = int.MaxValue; // add rooms to the listview foreach (Room tmpRoom in roomList) { // make sure the room has Level, that's it locates at level. if (tmpRoom.Document.GetElement(tmpRoom.LevelId) == null) { continue; } int idValue = tmpRoom.Id.IntegerValue; 144 string roomId = idValue.ToString(); // create a list view Item ListViewItem tmpItem = new ListViewItem(roomId); tmpItem.SubItems.Add(tmpRoom.Name); //display room name. tmpItem.SubItems.Add(tmpRoom.Number); //display room number. tmpItem.SubItems.Add((tmpRoom.Document.GetElement(tmpRoom.LevelId) as Level).Name); //display the level // get department name from Department property departmentName = m_data.GetProperty(tmpRoom, BuiltInParameter.ROOM_DEPARTMENT) + ""; tmpItem.SubItems.Add(departmentName); // get property value propertyValue = m_data.GetProperty(tmpRoom, BuiltInParameter.ROOM_AREA); // get the area value areaValue = Double.Parse(propertyValue); tmpItem.SubItems.Add(propertyValue + " SF"); // int roomArea = Int32.Parse(propertyValue); //int roomArea = 0; //Int32.TryParse(propertyValue, out roomArea); // calculate the occupancy areaValue = Convert.ToInt64(areaValue); if (departmentName.Equals("Agricultural building")) { AreaPerOccupant = 300; } else if (departmentName.Equals("Warehouse")) { AreaPerOccupant = 500; } else if (departmentName.Equals("Residential")) { AreaPerOccupant = 200; } else if (departmentName.Equals("Reading room")) { AreaPerOccupant = 50; } else if (departmentName.Equals("Industrial area")) { AreaPerOccupant = 100; } else if (departmentName.Equals("Exercise room")) { AreaPerOccupant = 50; } else if (departmentName.Equals("Business area")) { AreaPerOccupant = 100; } else if (departmentName.Equals("Exhibit gallery and Museum")) { AreaPerOccupant = 30; } else if (departmentName.Equals("Commercial")) { AreaPerOccupant = 200; } else if (departmentName.Equals("Decks")) 145 { AreaPerOccupant = 15; } else if (departmentName.Equals("Kitchen")) { AreaPerOccupant = 200; } else if (departmentName.Equals("Classroom area")) { AreaPerOccupant = 20; } else if (departmentName.Equals("")) { AreaPerOccupant = 10000; } else if (departmentName.Equals("Vocational room areas")) { AreaPerOccupant = 50; } occupancyValue = Convert.ToInt32(Math.Ceiling(areaValue / AreaPerOccupant)); tmpItem.SubItems.Add(occupancyValue.ToString() + " "); tmpItem.SubItems.Add(AreaPerOccupant + " "); tmpItem.SubItems.Add(areaValue + " SF"); // add the item to the listview roomsListView.Items.Add(tmpItem); // add the area to the department m_data.CalculateDepartmentArea(departmentName, areaValue, occupancyValue); } } private void RoomInfoForm_Load(object sender, EventArgs e) { roomsListView.Items.Clear(); // add rooms in the list roomsWithoutTag to the listview this.DisplayRooms(m_data.RoomsWithoutTag, false); // add rooms in the list roomsWithTag to the listview this.DisplayRooms(m_data.RoomsWithTag, true); // display the total area of each department this.DisplayDartmentsInfo(); } // display total rooms' information for each occupancy type private void DisplayDartmentsInfo() { for (int i = 0; i < m_data.DepartmentInfos.Count; i++) { // create a listview item ListViewItem tmpItem = new ListViewItem(m_data.DepartmentInfos[i].DepartmentName); tmpItem.SubItems.Add(m_data.DepartmentInfos[i].RoomsAmount.ToString()); 146 tmpItem.SubItems.Add(m_data.DepartmentInfos[i].DepartmentAreaValue + " SF"); tmpItem.SubItems.Add(m_data.DepartmentInfos[i].DepartmentOccupancyValue.ToSt ring()); departmentsListView.Items.Add(tmpItem); } } // Save the information into an Excel file private void exportButton_Click(object sender, EventArgs e) { // create a save file dialog using (SaveFileDialog sfdlg = new SaveFileDialog()) { sfdlg.Title = "Export area of department to Excel file"; sfdlg.Filter = "CSV(command delimited)(*.csv)|*.csv"; sfdlg.RestoreDirectory = true; if (DialogResult.OK == sfdlg.ShowDialog()) { m_data.ExportFile(sfdlg.FileName); } } } private void departmentsListView_SelectedIndexChanged(object sender, EventArgs e) { } } } Find farthest corner points private static void AppendRoomNearCornerPoints(Room room, List<XYZ> nearCornerPoints, Document doc, ViewPlan viewPlan) { ElementId levelId = viewPlan.GenLevel.Id; // find doors on level FilteredElementCollector fec2 = new FilteredElementCollector(doc, viewPlan.Id); fec2.OfCategory(BuiltInCategory.OST_Doors); // setup results ResultsSummary resultsSummary = new ResultsSummary(); List<XYZ> endPoints = new List<XYZ>(); 147 // Loop on doors and collect the door's origin points foreach (Element element in fec2) { Instance doorElement = (Instance)element; Transform trf = doorElement.GetTransform(); endPoints.Add(trf.Origin); } resultsSummary.numDoors = endPoints.Count; IList<IList<BoundarySegment>> segments = room.GetBoundarySegments(new SpatialElementBoundaryOptions()); if (segments == null || segments.Count == 0) return; IList<BoundarySegment> firstSegments = segments[0]; int numSegments = firstSegments.Count; // Find the farthest point in the rooms, near-corner points are offset from the room boundaries by 0.5 ft double maxDistance = 0; XYZ farthestConerPoint = null; for (int i = 0; i < numSegments; i++) { BoundarySegment seg1 = firstSegments.ElementAt(i); BoundarySegment seg2 = firstSegments.ElementAt(i == numSegments - 1 ? 0 : i + 1); Curve curve1 = seg1.GetCurve(); Curve curve2 = seg2.GetCurve(); Curve offsetCurve1 = curve1.CreateOffset(-0.5, XYZ.BasisZ); Curve offsetCurve2 = curve2.CreateOffset(-0.5, XYZ.BasisZ); IntersectionResultArray intersections = null; SetComparisonResult result = offsetCurve1.Intersect(offsetCurve2, out intersections); if (result == SetComparisonResult.Overlap && intersections.Size == 1) { // nearCornerPoints.Add(intersections.get_Item(0).XYZPoint); XYZ cornerPoint = intersections.get_Item(0).XYZPoint; //double currentDistance = cornerPoint.DistanceTo(endPoints.Last()); double maxDisFromStartToEnd = 0; for (int j = 0; j < endPoints.Count(); j++) { double disFromStartToEnd = cornerPoint.DistanceTo(endPoints[j]); maxDisFromStartToEnd = disFromStartToEnd > maxDisFromStartToEnd ? disFromStartToEnd : maxDisFromStartToEnd; } //double currentDistance = cornerPoint.DistanceTo(endPoints.Last()); if (maxDisFromStartToEnd > maxDistance) { farthestConerPoint = cornerPoint; maxDistance = maxDisFromStartToEnd; 148 } } } nearCornerPoints.Add(farthestConerPoint); }
Abstract (if available)
Abstract
As a building information modeling (BIM) platform, Revit has powerful modeling tools that can create comprehensive and accurate building data. In addition to using the Revit menu or toolbar commands for architectural design, Revit also provides an application programming interface (API) for external programs to manipulate and access Revit
Linked assets
University of Southern California Dissertations and Theses
Conceptually similar
PDF
Revit plugins for electrical engineering improvements in buildings: Lighting power density and electrical equipment placement
PDF
Streamlining sustainable design in building information modeling: BIM-based PV design and analysis tools
PDF
A BIM-based tool for accessible design standard plan check: an automated plan review plug-in for Revit focusing on accessible design
PDF
Carbon accounting tool (CAT) in BIM: an embodied carbon plug-in for revit
PDF
Streamlining precast back-frame design: automated design using Revit plugin
PDF
BIM+AR in architecture: a building maintenance application for a smart phone
PDF
Interoperability between building information models (BIM) and energy analysis programs
PDF
Using building information modeling with augmented reality: visualizing and editing MEP systems with a mobile augmented reality application
PDF
A BIM-based visualization tool for facilities management: fault detection through integrating real-time sensor data into BIM
PDF
Bridging the gap: a tool to support bim data transparency for interoperability with building energy performance software
PDF
MM Electrical Tool: a tool for generating electrical single line diagrams in BIM
PDF
Building information modeling: guidelines for project execution plan (PxP) for India
PDF
Planning in advance for rehabilitation and restoration using BIM and seismic simulation to record and analyze the Japanese House in Los Angeles
PDF
Building information modeling based design review and facility management: Virtual reality workflows and augmented reality experiment for healthcare project
PDF
Building bridges: filling gaps between BIM and other tools in mechanical design
PDF
Visualizing thermal data in a building information model
PDF
Multi-domain assessment of a kinetic facade: determining the control strategy of a kinetic façade using BIM based on energy performance, daylighting, and occupants’ preferences; Multi-domain asse...
PDF
Office floor plans generation based on Generative Adversarial Network
PDF
Guidelines to airport design: accounting for glare from buildings during takeoff and landing – an LAX case study
PDF
District energy systems: Studying building types at an urban scale to understand building energy consumption and waste energy generation
Asset Metadata
Creator
Hu, Wenxin
(author)
Core Title
Automating fire code compliance using BIM and Revit plug-ins
School
School of Architecture
Degree
Master of Building Science
Degree Program
Building Science
Publication Date
04/28/2021
Defense Date
03/15/2021
Publisher
University of Southern California
(original),
University of Southern California. Libraries
(digital)
Tag
building information modeling (BIM),fire code check,fire code compliance,OAI-PMH Harvest,Revit API
Language
English
Contributor
Electronically uploaded by the author
(provenance)
Advisor
Kensek, Karen (
committee chair
), Schiler, Marc (
committee member
), Tomerlin, Cassandra (
committee member
)
Creator Email
wenxinh@usc.edu,wenxinhupipi@gmail.com
Permanent Link (DOI)
https://doi.org/10.25549/usctheses-c89-454665
Unique identifier
UC11668585
Identifier
etd-HuWenxin-9557.pdf (filename),usctheses-c89-454665 (legacy record id)
Legacy Identifier
etd-HuWenxin-9557.pdf
Dmrecord
454665
Document Type
Thesis
Rights
Hu, Wenxin
Type
texts
Source
University of Southern California
(contributing entity),
University of Southern California Dissertations and Theses
(collection)
Access Conditions
The author retains rights to his/her dissertation, thesis or other graduate work according to U.S. copyright law. Electronic access is being provided by the USC Libraries in agreement with the a...
Repository Name
University of Southern California Digital Library
Repository Location
USC Digital Library, University of Southern California, University Park Campus MC 2810, 3434 South Grand Avenue, 2nd Floor, Los Angeles, California 90089-2810, USA
Tags
building information modeling (BIM)
fire code check
fire code compliance
Revit API