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
/
Carbon accounting tool (CAT) in BIM: an embodied carbon plug-in for revit
(USC Thesis Other)
Carbon accounting tool (CAT) in BIM: an embodied carbon plug-in for revit
PDF
Download
Share
Open document
Flip pages
Contact Us
Contact Us
Copy asset link
Request this asset
Transcript (if available)
Content
Carbon Accounting Tool (CAT) in BIM : An Embodied Carbon Plug-in for Revit By Xiangyu Sun A Thesis Presented to the FACULTY OF THE USC SCHOOL OF ARCHITECTURE UNIVERSITY OF SOUTHERN CALIFORNIA In Partial Fulfillment of the Requirements of the Degree MASTER OF BUILDING SCIENCE May 2023 ii Acknowledgements I would like to express my deepest gratitude to my Master thesis committee members, Karen Kensek, Marc Schiler, and Stan Zhao. I am incredibly grateful for their valuable guidance, support, and feedback throughout the thesis process. First and foremost, I would like to thank my thesis chair, Karen Kensek, for her unwavering support, guidance, and patience. Her expertise, valuable insights, and constructive criticism have been instrumental in shaping my research and improving the quality of my work. I am truly grateful for her mentorship and for the countless hours she has dedicated to reviewing my work and providing me with invaluable feedback. I would also like to express my gratitude to Marc Schiler and Stan Zhao for their valuable input and feedback throughout the thesis process. Their constructive criticism and insightful comments have been crucial in shaping the direction of my research and improving the quality of my work. I am also grateful to the faculty and staff at USC for their support and resources throughout my studies. I would like to extend my sincere appreciation to my friends and colleagues who have provided me with encouragement and support throughout my academic journey. Finally, thank you all for the invaluable contributions to my academic journey. iii Table of Contents Acknowledgements ...........................................................................................................................ii List of Tables .................................................................................................................................... vi List of Figures .................................................................................................................................vii Abstract ...........................................................................................................................................xii Chapter 1: Introduction ..................................................................................................................... 1 1.1 Building Information Modeling (BIM) ............................................................................... 3 1.2 The Revit API ...................................................................................................................... 8 1.2.1 Process Overview ..................................................................................................... 9 1.2.2 .NET Framework .................................................................................................... 11 1.2.3 Simple Example ..................................................................................................... 15 1.2.4 An Example of A Plug-in for Revit for Architecture .............................................. 18 1.3 Carbon Neutrality (Carbon Offset) Design ....................................................................... 19 1.3.1 Carbon Offset ......................................................................................................... 22 1.3.2 Embodied Carbon vs. Life Cycle Carbon .............................................................. 23 1.3.3 Similar Software .................................................................................................... 24 1.3.3 Government Regulations on Low Carbon .............................................................. 27 (1) US government Regulations and V oluntary Measures .............................................. 27 (2) China Government Regulations and V oluntary Measures ......................................... 29 1.4 Carbon Trading, Carbon Emission, and Embodied Carbon .............................................. 30 1.4.1 Carbon Trading ...................................................................................................... 32 1.4.2 US Standard of Carbon Emission and Embodied Carbon ...................................... 33 1.4.3 China Standard of Carbon Emission and Embodied Carbon ................................. 34 1.4.4 The Difference Between US and China Standard of Embodied Carbon ................ 35 1.5 Building Materials and Tree CO2 Databases .................................................................... 36 1.5.1 Database of Embodied Cardon in Building Materials ............................................ 37 1.5.2 Database of Embodied Carbon in Trees ................................................................. 38 1.6 Summary ........................................................................................................................... 39 Chapter 2: Literature Review .......................................................................................................... 40 2.1 Embodied Carbon and Operational Carbon ...................................................................... 41 2.2 Carbon Accounting as a Critical Methodology in Embodied Carbon Estimation ............. 43 2.3 Methodology for Carbon Neutrality .................................................................................. 47 2.3.1 Life Cycle Assessment (LCA)................................................................................ 48 2.3.2 The Global Warming Potential (GWP) .................................................................. 48 2.3.3 EPDs (Environmental Product Declarations) ......................................................... 49 2.4 Carbon Trading ................................................................................................................. 50 2.4.1 The US Regional Greenhouse Gas Emission Standard .......................................... 51 2.4.2 Methodology for Carbon Trading .......................................................................... 54 2.5 Tree Database with Sequestration ..................................................................................... 55 2.6 Revit API Development .................................................................................................... 59 2.7 Summary ........................................................................................................................... 61 Chapter 3: Methodology ................................................................................................................. 62 3.1 Establish the Environment of Revit API Development ..................................................... 66 iv 3.1.1 Revit SDK 2023 ..................................................................................................... 66 3.1.2 Revit Lookup .......................................................................................................... 67 3.1.3 Configuring AddInManager ................................................................................... 68 3.1.4 Create Project in Visual Studio with .NET Framework ......................................... 70 3.1.5 RevitAPI.dll and RevitAPIUI.dll ........................................................................... 71 3.2 Basic Programming Modules ............................................................................................ 73 3.3 Codes for different functions ............................................................................................ 77 3.3.1 Assembly Information of Program ......................................................................... 77 3.3.2 View Model of First User Interface ........................................................................ 78 3.3.3 Reading the Materials Information ........................................................................ 79 3.3.4 Headers of the First User Interface Screen ............................................................. 81 3.3.5 View Model of Carbon Unit Spread Sheet ............................................................. 83 3.3.6 Functions of Carbon Spread Sheet in Plug-in ........................................................ 85 3.3.7 Choose the Declared Unit in Carbon Spread Sheet ................................................ 86 3.3.8 Calculate the Read Material’s Value in Total ......................................................... 88 3.3.9 Isolate the Read Material ....................................................................................... 89 3.3.10 View Model of Tree Sheet .................................................................................... 90 3.3.11 View Model of Adding Data in Tree Sheet ........................................................... 92 3.3.12 Functions of Tree Sheet in Plug-in ....................................................................... 93 3.3.13 View Model of Second User Interface ................................................................. 94 3.3.14 View Model of Adding the Input Tree Data ......................................................... 95 3.3.15 View Model of Tress Mass Method ..................................................................... 96 3.3.16 Images Used in Plug-in ........................................................................................ 98 3.4 Summary ......................................................................................................................... 100 Chapter 4: Case Study – Using the CAT Plug-in .......................................................................... 104 4.1 Starting Guide of Carbon Accounting Tool (CAT) .......................................................... 104 4.1.1 Download the VS File and Revit File .................................................................. 105 4.1.2 Open Sample Building File in Revit. ................................................................... 105 4.1.3 External Tools in Revit Add-Ins ........................................................................... 107 4.1.4 Enter the First User Interface ............................................................................... 112 4.1.5 Isolation of the Read Materials ............................................................................ 115 4.1.6 Carbon Unit Sheet ................................................................................................ 117 4.1.7 Process of ‘Unknown’ and Layers of Materials ................................................... 122 4.1.8 Tree Sheet ............................................................................................................. 127 4.1.9 Enter the Second User Interface ........................................................................... 130 4.1.10 Tree Count Method for Carbon Neutrality ......................................................... 131 4.1.11 Tree Mass Method for Carbon Neutrality .......................................................... 135 4.1.12 Carbon Trading................................................................................................... 136 4.2 Carbon Accounting Results for a Sample House ............................................................ 137 4.2.1 Sample House ...................................................................................................... 137 4.2.2 List and Images of All the Revit Components Used in The Calculation .............. 138 4.2.3 Isolation of the Read Materials ............................................................................ 140 4.2.4 Pre-defined Materials with Embodied Carbon Content ....................................... 141 4.2.5 Total Embodied Carbon Calculation .................................................................... 142 v 4.2.6 Pre-defined Trees in Tree Sheet ........................................................................... 143 4.2.7 Tree Count Method in the Second User Interface ................................................ 144 4.2.8 Tree Mass Method in the Second User Interface ................................................. 145 4.3 Summary ......................................................................................................................... 146 Chapter 5: Discussion ................................................................................................................... 147 5.1 Embodied Carbon Calculator for Construction (EC3) .................................................... 148 5.1.1 EC3 and CAT plug-in ........................................................................................... 149 5.2 Sample Building - Concrete and Brick ........................................................................... 150 5.2.1 CAT Plug-in ......................................................................................................... 151 5.2.2 EC3 ...................................................................................................................... 153 5.3 Sample Building -Wood .................................................................................................. 156 5.3.1 CAT Plug-in ......................................................................................................... 157 5.3.2 EC3 ...................................................................................................................... 159 5.4 Overall Comparison and Analysis of Two Tools ............................................................. 161 5.4.1 Comparison of Sample Concrete and Wood Building Results ............................. 161 5.4.2 Comparison of Interface ....................................................................................... 164 5.4.3 Comparison of Ability to Read Revit Components .............................................. 166 5.4.4 Comparison of Ability to Read Layers of Materials ............................................ 176 5.4.5 Comparison of the V olume of Each Read Material .............................................. 178 5.4.6 Comparison of Output .......................................................................................... 183 5.5 Analysis of Errors and Differences ................................................................................. 186 5.6 Summary ......................................................................................................................... 188 Chapter 6: Conclusions and Future Work ..................................................................................... 190 6.1 Discussion of the Workflow ............................................................................................ 191 6.2 CAT Features ................................................................................................................... 194 6.3 Current Limitations of the Tool ....................................................................................... 200 6.4 Future Work .................................................................................................................... 202 6.4.1 Improvements to the Tool .................................................................................... 202 6.4.2 Improvements to Sequestering of Carbon ............................................................ 205 6.5 Summary ......................................................................................................................... 210 References ..................................................................................................................................... 213 Appendix ....................................................................................................................................... 217 vi List of Tables Table 3-1 Component List ............................................................................................................. 102 Table 4-1 List and Images of All the Revit Components Used in The Calculation ....................... 140 Table 5-1 Comparison Table of the Sample Values of the Material Libraries of the Two Tools ... 163 Table 5-2 Comparison Table of the Results of the Two Software ................................................. 180 Table 5-3 Comparison Table of the Results of the Two Software ................................................. 182 Table 6-1 Components List That CAT Plug-in Can or Cannot Read ............................................ 198 vii List of Figures Figure 1-1 Global CO 2 Emissions ..................................................................................................... 1 Figure 1-2 BIM Certified Construction Management in Houston .................................................... 4 Figure 1-3 Plan View of System Family: Basic Wall with Two Layers ............................................ 7 Figure 1-4 Wall Material Takeoff in Revit ........................................................................................ 7 Figure 1-5 Combining Take-off of Materials From Revit with Other Data ...................................... 8 Figure 1-6 Dynamo DesignScript ..................................................................................................... 9 Figure 1-7 The Basic Workflow of Revit API development ........................................................... 13 Figure 1-8 Add-In Manager Sector ................................................................................................. 14 Figure 1-9 Read Element Materials ................................................................................................ 15 Figure 1-10 Unit Conversion .......................................................................................................... 17 Figure 1-11-1 One Click LCA Visualization ............................................................................... 19 Figure 1-11-2 One Click LCA Sample Result Output .................................................................... 19 Figure 1-12 Corporate Net-Zero ..................................................................................................... 21 Figure 1-13 Corporate Carbon Neutrality ....................................................................................... 21 Figure 1-14 Corporate Carbon Neutrality ....................................................................................... 24 Figure 1-15-1 Carbon Software and Tools Matrix (1) (See Appendix A for a larger table) ............ 25 Figure 1-15-2 Carbon Software and Tools Matrix (2) (See Appendix A for a larger table) ............ 25 Figure 1-15-3 Annotation of A1-A5, B1-B5, C1-C5 ...................................................................... 26 Figure 1-15-4 Annotation of P1-P15 ............................................................................................... 26 Figure 1-16 How Carbon Trading Works ........................................................................................ 31 Figure 1-17 Carbon Market ............................................................................................................. 32 Figure 1-18 IECC Climate Zone Map ............................................................................................. 39 Figure 2-1 Carbon life cycle phases of a building .......................................................................... 42 Figure 2-2 A Sample EPD for a Concrete Mix Design by Central Concrete Supply Co. ............... 50 Figure 3-1 Methodology Diagram .................................................................................................. 63 Figure 3-2 First User Interface ........................................................................................................ 64 Figure 3-3 Second User Interface ................................................................................................... 65 Figure 3-4 Code Modules ............................................................................................................... 66 Figure 3-5 Revit 2023 SDK ............................................................................................................ 67 Figure 3-6 Revit Lookup ................................................................................................................. 68 Figure 3-7 Revit Add-Ins 2023 Files ............................................................................................... 69 Figure 3-8 Autodesk.AddInManager.addin Program ...................................................................... 70 Figure 3-9 Create New Project ........................................................................................................ 70 Figure 3-10 .NET Framework 6.0 ................................................................................................... 71 Figure 3-11 References of Explorer in VS ...................................................................................... 72 Figure 3-12 ExternalCommand.cs .................................................................................................. 73 Figure 3-13 Basic Modules of Programming .................................................................................. 74 Figure 3-14 Simple Building Model ............................................................................................... 75 Figure 3-15 Different Layers of One Wall ...................................................................................... 75 Figure 3-16 Calculation Output with All the Read Layers .............................................................. 76 viii Figure 3-17 Assembly Info.cs ......................................................................................................... 78 Figure 3-18 Embodied Carbon Calculation Interface ..................................................................... 79 Figure 3-19 Read Wall Material ...................................................................................................... 80 Figure 3-20 Read Floor Material..................................................................................................... 80 Figure 3-21 Read Roof Material ..................................................................................................... 81 Figure 3-22 Read Framing Material ................................................................................................ 81 Figure 3-23 Read Columns Material ............................................................................................... 81 Figure 3-24 Headers of Line and Columns in First User Interface ................................................. 82 Figure 3-25 Codes of Headers ........................................................................................................ 82 Figure 3-26 Carbon Unit Spreadsheet ............................................................................................. 83 Figure 3-27 Category of the Input Material .................................................................................... 84 Figure 3-28 Embodied Carbon Calculation in First UI ................................................................... 85 Figure 3-29 Carbon Spreadsheet Functions .................................................................................... 86 Figure 3-30 Codes of Declared Unit in Carbon Unit Sheet ............................................................ 87 Figure 3-31 Declared Unit in Carbon Unit Sheet ............................................................................ 87 Figure 3-32 Codes of Embodied Carbon Calculation ..................................................................... 88 Figure 3-33 Embodied Carbon Calculation in the First User Interface ........................................... 89 Figure 3-34 Isolation Function ........................................................................................................ 90 Figure 3-35 Isolation Button ........................................................................................................... 90 Figure 3-36 Codes of Tree Sheet ..................................................................................................... 91 Figure 3-37 Tree Sheet Interface ..................................................................................................... 92 Figure 3-38 Adding Data in Tree Sheet ........................................................................................... 92 Figure 3-39 Adding Data in the Tree Sheet Interface ...................................................................... 93 Figure 3-40 Tree Sheet Codes ......................................................................................................... 94 Figure 3-41 Carbon Accounting Interface ....................................................................................... 95 Figure 3-42 Codes of Carbon Accounting Interface ....................................................................... 95 Figure 3-43 Adding the Input Data ................................................................................................. 96 Figure 3-44 Two Methods for Carbon Neutrality in Second UI ..................................................... 97 Figure 3-45 Codes of Methods for Carbon Neutrality .................................................................... 97 Figure 3-46 Logo of ‘CAT’ ............................................................................................................. 98 Figure 3-47 Codes of Logo of ‘CAT’ .............................................................................................. 99 Figure 3-48 Climate Zone Map ....................................................................................................... 99 Figure 3-49 Codes of Climate Zone Map ....................................................................................... 99 Figure 3-50 Tips of Default Value of Tree Mass Method .............................................................. 100 Figure 3-51 Codes of Tips of Default Value of Tree Mass Method .............................................. 100 Figure 4-1 CAT Plug-in VS File ................................................................................................... 105 Figure 4-2 Sample Building .......................................................................................................... 105 Figure 4-3 Open Sample Building. rvt .......................................................................................... 106 Figure 4-4 A Simple Building Model ............................................................................................ 106 Figure 4-5 Add-In Manager (Manual Mode) ................................................................................ 107 Figure 4-6 Add-In Manager Interface ........................................................................................... 108 Figure 4-7 ‘bin’ File ...................................................................................................................... 109 Figure 4-8 ‘debug’ File ................................................................................................................. 109 Figure 4-9 CarbonEmissio.dll ....................................................................................................... 110 ix Figure 4-10 CarbonEmissio.dll in Add-In Manager ...................................................................... 111 Figure 4-11 Carbon Emissio.ExternalCommand .......................................................................... 112 Figure 4-12 First User Interface .................................................................................................... 113 Figure 4-13 Total Embodied Carbon of the Read Material ........................................................... 115 Figure 4-14 Isolation Function ...................................................................................................... 116 Figure 4-15 Before Isolation ......................................................................................................... 116 Figure 4-16 After Isolation ............................................................................................................ 117 Figure 4-17 Carbon Unit Sheet ..................................................................................................... 118 Figure 4-18 Add Fixed Data .......................................................................................................... 119 Figure 4-19 Various Value Unit ..................................................................................................... 119 Figure 4-20 Pre-defined Concrete, Precast Material Sample ........................................................ 120 Figure 4-21 Add Slide Data .......................................................................................................... 121 Figure 4-22 0-2500psi Concrete Slide Data .................................................................................. 122 Figure 4-23 0-2500psi Concrete Slide Data .................................................................................. 122 Figure 4-24 Undefined Material Iron, Ductile .............................................................................. 123 Figure 4-25 ‘Unknown’ Situation ................................................................................................. 124 Figure 4-26 The Material Name that has been read and CO 2 e that has been calculated ............... 125 Figure 4-27 Basic Wall with Three Different Layers .................................................................... 126 Figure 4-28 Basic Wall with Three Different Layers .................................................................... 126 Figure 4-28 Tree Sheet .................................................................................................................. 127 Figure 4-29 Add Tree Data ............................................................................................................ 128 Figure 4-30 Climate Zones 1-8 ..................................................................................................... 128 Figure 4-31 Various Units ............................................................................................................. 129 Figure 4-32 Case Study Tree Data ................................................................................................ 130 Figure 4-33 Second User Interface with IECC Climate Zones Map ............................................. 131 Figure 4-34 Tree Count Method .................................................................................................... 131 Figure 4-35 Add Tree Data ............................................................................................................ 132 Figure 4-36 Tree Types ................................................................................................................. 133 Figure 4-37 The Number of Trees Required in The Case of Planting Only One Type of Tree. .... 134 Figure 4-38 Green Surplus CO 2 .................................................................................................... 135 Figure 4-39 Red Surplus CO 2 ....................................................................................................... 135 Figure 4-40 Tree Mass Method ..................................................................................................... 136 Figure 4-41 Carbon Trading .......................................................................................................... 137 Figure 4-42 A Sample House for Case Study ................................................................................ 138 Figure 4-43 Isolation for the Case Study ...................................................................................... 141 Figure 4-44 Pre-defined Carbon Unit Sheet .................................................................................. 142 Figure 4-45 Total Embodied Carbon Calculation ......................................................................... 143 Figure 4-46 Pre-defined Tree Sheet .............................................................................................. 144 Figure 4-47 Carbon Accounting with Tree Count Method............................................................ 145 Figure 4-48 Carbon Accounting with Tree Mass Method ............................................................. 146 Figure 5-1 Sample Building Model with Concrete and Brick Materials....................................... 150 Figure 5-2 Multi-Category Material Takeoff ................................................................................ 151 Figure 5-3 Pre-defined Carbon Unit Sheet .................................................................................... 152 Figure 5-4 Total Embodied Carbon in CAT plug-in ...................................................................... 153 x Figure 5-5 Import from Autodesk ................................................................................................. 153 Figure 5-6 Import the Building Model in EC3 .............................................................................. 154 Figure 5-7 EPDs of EC3 ............................................................................................................... 155 Figure 5-8 The Read Material in EC3 ........................................................................................... 155 Figure 5-9 Total Embodied Carbon in EC3 ................................................................................... 156 Figure 5-10 Sample Building Model with Wood Materials .......................................................... 156 Figure 5-11 Multi-Category Material Takeoff ............................................................................... 157 Figure 5-12 Pre-defined Carbon Unit Sheet .................................................................................. 158 Figure 5-13 Total Embodied Carbon in CAT plug-in .................................................................... 159 Figure 5-14 Import the Building Model in EC3 ............................................................................ 160 Figure 5-15 The Read Material in EC3 ......................................................................................... 160 Figure 5-16 Total Embodied Carbon in EC3................................................................................. 161 Figure 5-17 First UI of CAT Plug-in ............................................................................................. 164 Figure 5-18 Second UI of CAT Plug-in ........................................................................................ 165 Figure 5-19 Plan & Compare Buildings UI in EC3 ...................................................................... 165 Figure 5-20 Define Materials with EPDs ...................................................................................... 166 Figure 5-21 Schedules of Sample Concrete and Brick Building ................................................... 167 Figure 5-22 Sample Concrete and Brick Building Materials Read by CAT Plug-in (A) .............. 168 Figure 5-22 Sample Concrete and Brick Building Materials Read by CAT Plug-in (B) .............. 169 Figure 5-23 Sample Concrete and Brick Building Materials Read by EC3 (A) ........................... 170 Figure 5-23 Sample Concrete and Brick Building Materials Read by EC3 (B) ........................... 170 Figure 5-24 The Materials That Cannot Read by CAT Plug-in but EC3....................................... 171 Figure 5-25 Schedules of Sample Wood Building ........................................................................ 172 Figure 5-26 Sample Wood Building Materials Read by CAT Plug-in (A) .................................... 173 Figure 5-26 Sample Wood Building Materials Read by CAT Plug-in (B) .................................... 174 Figure 5-27 Sample Wood Building Materials Read by EC3 (A) ................................................. 175 Figure 5-27 Sample Concrete and Brick Building Materials Read by EC3 (B) ........................... 175 Figure 5-28 The Materials That Cannot Read by CAT Plug-in but EC3....................................... 175 Figure 5-29 Different Layers of the Wall ...................................................................................... 176 Figure 5-30 CAT Plug-in’s Ability to Read Different Layers ....................................................... 177 Figure 5-31 Different Names of Entire Walls Read by EC3 ......................................................... 178 Figure 5-32 A Stacked Bar Chart in EC3 ...................................................................................... 184 Figure 5-33 GWP (Global Warming Potential) Sankey diagram .................................................. 185 Figure 5-34 Carbon Neutrality and Trading Function in CAT Plug-in ......................................... 186 Figure 6-1 Workflow ..................................................................................................................... 191 Figure 6-2 Material Information, Tree Sheet, and Carbon Unit Sheet on the First UI .................. 195 Figure 6-3-1 Isolation Button (lower left corner), Not Isolated, Isolated ..................................... 195 Figure 6-4 Total Value of Embodied Carbon ................................................................................ 196 Figure 6-5 Basic Wall with Three Different Layers ...................................................................... 197 Figure 6-6 Layers’ Readout Results in CAT Plug-in ..................................................................... 197 Figure 6-7 Second UI of CAT Plug-in .......................................................................................... 199 Figure 6-8 Second UI of CAT Plug-in .......................................................................................... 200 Figure 6-9 The Average (production-weighted) Water Footprint Per Unit of Roundwood ........... 207 Figure 6-10 Minimum, Ideal and Maximum Temperature of Different Trees .............................. 209 xi Figure 1-15-1 Appendix Carbon Software and Tools Matrix (1) .................................................. 217 Figure 1-15-2 Appendix Carbon Software and Tools Matrix (2) .................................................. 218 xii Abstract More attention is being concentrated on the embodied carbon and operational carbon performance by enterprises, corporations, and governments while designers, architects, and engineers need information about building materials to make smarter choices. EC3 and Tally are very useful tools that focus on the upfront supply chain emissions of construction materials and can work with BIM to calculate the carbon emission with the standard of the United States. A separate plug-in is created with C# programming language for the secondary development in Revit 2023. This plug-in is different from EC3 and Tally by selecting different types of trees or trees of the appropriate weight to plant to achieve carbon offsets, and the remaining carbon can be purchased at a price based on the real-time carbon credit price. Carbon Accounting Tool (CAT), a new software program, was created with Net Framework using Visual Studio (VS), then creates a class library and associated Revit API.dll to implement the interface between VS and Revit. The final plug-in can read the materials of the building model through element materials and calculate the total amount of embodied carbon for each material in the current volume according to the carbon spreadsheet defined in advance or customized for a Revit 3d model. Then the user can freely select the tree types in different climate zones according to the building location, and make the current building carbon neutral according to the predefined annual CO2 absorption of each tree. If any remaining carbon cannot be neutralized, the xiii user can find out how many carbon credits to purchase and the price in the last step of the carbon trading interface in the plug-in. The concept of carbon neutrality is to keep the additional carbon from being released into the atmosphere, which is also regarded as a carbon offset. The total amount of carbon dioxide or greenhouse gas emissions produced directly or indirectly by a country, enterprise, product, activity, or individual within a certain period is offset by planting trees, energy conservation, and other forms of emission reduction to achieve positive and negative offset, and achieve relative "zero emissions." This plug-in can indicate that the carbon offset for this construction modeling considers the existing plants and the requirements of planting to reach the zero target. Additionally, carbon trading, a practice designed to reduce carbon dioxide and other greenhouse gas emissions by providing regulatory and economic incentives, is also an important field for the plug- in. Designers and builders can select the specific types of trees or trees of corresponding weight to plant to offset the building’s carbon emissions, thus achieving carbon neutrality without the purchase of carbon trading. Key Words: Carbon accounting, Carbon trading, Revit API, C# Programming Hypothesis: Embodied carbon is a very important part of all carbon emissions throughout the life xiv cycle of a building. A simple plug-in can be created in Revit that calculates embodied carbon. Research Objectives: • Develop a carbon calculator plug-in to run in Revit by linking quantities in Revit with a database of materials • Be able to split complex materials in Revit into their constituent components • Create a database of building materials and their embodied carbon • Create a database of trees that also provides the carbon absorption of trees in different climate zones for designers to choose from • Automatically calculate how much a building will pay for carbon trading based on carbon neutrality criteria. 1 Chapter 1: Introduction Because some of the embodied carbon from construction materials is generated during construction or transportation, reducing and controlling embodied carbon can effectively control the greenhouse gas emissions from the construction industry. In response to the construction industry contributing 40% of annual greenhouse gas emissions advanced architecture has become increasingly concerned with the use of low-carbon technologies, and the built environment has gradually transitioned to low- carbon (China Daily, 2020) (Fig. 1-1). Figure 1-1 Global CO2 Emissions (Harris, 2020) Building Information Modeling (BIM) digitally transforms three major aspects of the AEC (architecture, engineering, construction) industry by providing a method to create a data-rich 3d model and manage building asset information (What Is BIM | Building 2 Information Modeling | Autodesk, 2022). BIM integrates multi-functional, multi- disciplinary data throughout the building lifecycle. A building information model can also be used with a carbon calculation tool. Revit by Autodesk is a leading BIM software program. EC3, Tally, and Beacon are three useful tools in the construction industry for listing and viewing the carbon footprint of buildings (Peng & Wu, 2015). These tools have been created to facilitate the design of buildings that prioritize low- carbon materials and specifications to create low-carbon buildings. All three tools can be integrated with Revit and run in Revit as plug-ins to directly calculate the carbon emissions of the building. Carbon neutrality, sometimes achieved using carbon offset, means that a balance is achieved between carbon emissions and carbon sinks that absorb carbon from the atmosphere (What Is Carbon Neutrality and How Can It Be Achieved by 2050? | News | European Parliament, n.d.). For example, if trees are planted around a building and the carbon dioxide absorbed by the trees balances the carbon dioxide emitted throughout the building's life cycle, then the building is carbon neutral. Carbon trading means that if the building is not carbon neutral, then the building is allowed to emit a certain amount of carbon dioxide or other greenhouse gases, but in compensation, the building must pay a corresponding amount of money in exchange for carbon credits or implement the low carbon design (Carbon Trade - CarbonFinance.IN, n.d.). The government can mitigate the impact on the atmosphere and environment by mandating and pricing carbon credits to facilitate building design toward decarbonization. This section introduces building information modeling, the Revit API, carbon neutrality 3 (carbon offset) design, carbon trading, carbon emission, and embodied carbon, and building materials and tree CO2 databases. 1.1 Building Information Modeling (BIM) BIM (building information modeling) is a data-based tool applied to architecture and engineering design, construction, and management, through the integration of data- based and information-based models of buildings. It can be shared and delivered in the whole life cycle process of project planning, operation, and maintenance so that engineers and technicians can make correct understanding and efficient responses to various building information for design teams and all construction entities including construction and operation units to provide a basis for collaborative work and play an important role in improving productivity, saving costs and shortening schedules (BaiduBaike, 2015). With BIM, the pre-construction team can map out construction plans for the owner's project, including electrical, plumbing, piping, fire protection, and other applicable trades. This information is combined so that the development of the underlying components of the 3D model can show multiple aspects of a design (Fig 1-2). 4 Figure 1-2 BIM Certified Construction Management in Houston (Bryant, 2022) Although prototyped previous to 2002, BIM technology was pioneered by Autodesk in 2002 and has been widely recognized by the industry worldwide (What next for AEC Software? - AEC Magazine, 2022). Its current stage of application means that the existing building will be built virtually once in the computer to solve unforeseen problems such as errors, collisions, spatial layout, equipment layout, and comprehensive coordination brought by the current stage of two-dimensional floor plans, and to improve the construction process and design quality. Digital information on design, construction, completion, operation and maintenance stages are integrated into the model to serve all stages of the whole life cycle of the building. The National BIM Standard (NBIMS) has a more sweeping view of BIM with three parts (About the National BIM Standard-United States® V4 | National BIM Standard - United States, n.d.): 5 (1) BIM is a digital representation of the physical and functional characteristics of a facility (construction project). (2) BIM is a shared knowledge resource, a process for sharing information about this facility to provide a reliable basis for all decisions throughout the facility's life cycle, from conception to demolition. (3) The collaborative operation of different stakeholders at different stages of the facility by inserting, extracting, updating, and modifying information in BIM to support and reflect their respective responsibilities BIM has the following characteristics: visualization, integration, coordination, optimization, durability, and project quantity statistics (Alshomer et al., 2019). With the promotion of digital technology, there will be more and more industries and fields involved in BIM, such as construction units, infrastructure, transportation, water conservancy, state grid, etc. BIM can be highly summarized as the design phase, construction phase, completion phase, and operation and maintenance phase (BIM Program Aims to Boost Construction’ s Digital Transformation | Construction Dive, 2022). The design phase includes virtual construction of all professional 3D models (architecture, structure, mechanical, electrical, piping (MEP), etc.), optimization of building structure diagram matching, collision check of architecture, structure, MEP, and other professional models, and simulation of roaming animation at the end of the design phase, etc. The construction phase includes deepening the design of architectural, structural, and MEP models, model making after equipment selection, BIM drawing 6 content of construction units, and 3D model materials (Peng & Wu, 2015). Building information models can also assist in class detection analysis, creating construction animations and cost estimates, and in the future, providing a virtual building to a client for use in facilities management. Because a building information model is a 3d description of a building and it can include data about materials, tools have been created to facilitate the design of buildings that prioritize low-carbon materials that can be used with BIM software (Architecture Phases of Design, Fontan Architecture, n.d.). For carbon accounting, three characteristics of BIM software, such as Autodesk Revit, are critical: parameters associated with objects (such as material), ability to take-off quantities (such as cubic feet of concrete), and capacity to use the API to create new tools (creating a plug-in). The parameters of the wall material include family name, type, thickness, mass, height, including the layers of the wall, and detailed materials. Similar parameters exist for all the components containing floors, roofs, columns, doors, and framing (Fig 1-3). There are other parameters, and more can be created as needed for each object. 7 Figure 1-3 Plan View of System Family: Basic Wall with Two Layers The Material Takeoff table is called a schedule in Revit. It displays the current value for each type of wall parameter based on the selected filter parameter, just like an Excel spreadsheet (Fig 1-4). Figure 1-4 Wall Material Takeoff in Revit A simple take-off of data from the building information model can include the family name (component’s name), material description, material results, and quantifiable data like volume among other attributes. These can later be attached to a separate database 8 or spreadsheet, in this example, for embodied CO2 content (Fig 1-5). Figure 1-5 Combining Take-off of Materials From Revit with Other Data 1.2 The Revit API The Revit API allows programming in any .NET compatible language. Although Revit software has very powerful functions for architects and engineers, there are still inevitable limitations that require engineers to develop and extend the functions of the software (Supported Programming Languages | Revit | Autodesk Knowledge Network, n.d.). 9 1.2.1 Process Overview There are two primary ways to use the Revit API. The first is to write C# (sometimes another computer language) code, call the underlying code of Revit API to design relevant algorithm programs, and load it into the Revit platform in the form of plug-ins, to achieve the development of functions (Lesson 1: The Basic Plug-in | Search | Autodesk Knowledge Network, 2022). A second way to create Revit secondary uses the development of Revit built-in visual programming in Dynamo. Dynamo is a graphical programming language where nodes are connected by wires (Chinarevit, 2021) (Fig 1- 6). It is similar to Grasshopper in Rhino. Figure 1-6 Dynamo DesignScript (DesignScript Syntax | The Dynamo Primer, 2022) These two Revit development methods have their advantages and disadvantages, in 10 terms of operational difficulty. Programming in something like C# requires developers to have a deeper programming foundation, which can be intimidating to non- programmers. Using Dynamo is easier, and the operation is simple, but in terms of the depth and breadth of the developed functions, the former can achieve more powerful and comprehensive functions, while the latter is limited by the nodes to achieve the functions. Although it can also be based on the Dynamo platform to write DesignScript language or even the Python language to expand the development of functions, the overall capability is still inferior to directly accessing the Revit API through C# (DesignScript Syntax | The Dynamo Primer, 2022). There are several competitive developers in the BIM industry, and usually, the developers do not disclose the core data format of their software. Hence, how to use the clean development interface provided by commercial software for data conversion is particularly important. At present, the more mature secondary development interfaces are mainly Autodesk products, including Revit API, Autocad.net, RealDWG developer, etc. For Autodesk's file format, there are also third-party file reading and writing SDKs like Teigha open dwg. In contrast, Bentley and ArchiCAD have weaker secondary development interfaces, and their communities are far less active than the Autodesk developer network (Chinarevit, 2020). 11 1.2.2 .NET Framework The Revit API can be programmed in development languages compatible with the .NET Framework, which provides a set of security models for user program development in which the code used can be ensured to be identified and the consistency of the programming language is guaranteed. NET-supported programming languages are C#, Visual Basic, C++, etc. C# is often used for plug-in development with Microsoft.NET Framework 4.8. Revit 2023, most useful for 3d modeling, is the most recent version, and the development software tool commonly used is Visual Studio 2022. “RevitAPl.dIl" and "RevitAPIUI.dlI" are dynamic link libraries used within Visual Studio. A DLL (dynamic link library) is a set of compact programs that can be loaded by larger programs when necessary to perform particular tasks. The DLL file, which is a small program, includes commands that assist the larger program in managing tasks that may not be a central function of the initial program. The file RevitAPI.dll is a dynamic link library associated with Autodesk Revit, a program utilized for architectural design and building information modeling. Within this file is a range of functions and procedures that Autodesk Revit utilizes to communicate with other programs or system components. RevitAPIUI.dll is another dynamic link library file that is related to Autodesk Revit software. This file contains user interface functions and classes that enable developers to create custom UI components and interact with the Revit user interface. 12 To extend its functional modules through Revit API, there are two special interface derived classes: external commands (IExternalCommand) and external applications (IExternalApplications). IExternalCommand is the command to implement external extensions in Revit API and contains an Execute function. External commands call the Execute function to implement IExternalCommand, Excute is defined in the way public Autodesk.Revit.UI.Result Execute (ExternalCommandData cmdData, ref string message ElementSet elements), respectively, for the input parameter CommandData(ExternalCommandData), the output parameter message(string), and the output parameter elements(ElementSet). The interface of IExternalApplication should implement two abstract functions: OnStartup and OnShutdown, using the OnStartup() function and OnShutdown) function to add developed Revit plugins. Customized functions are required when starting and closing Revit by adding the corresponding function code in the external command during development, attaching it to the framework of the external application, and then using the .addin registration file to jointly control the identification and loading of the external plug-in, which is generally used to create the menu bar of the plug-in (Fig. 1-7). 13 Figure 1-7 The Basic Workflow of Revit API development The Revit API provides a variety of properties for users to easily configure the behavior of their ExternalCommand and ExternalApplication. The Transaction property is added to the command class to control the transaction mode and update mode of command, usually choosing the Manual mode, and the Transaction property, which the user must 14 specify when implementing the IExternalCommand interface. Regeneration is used to control the regeneration behavior of external commands or external applications. Adding a transaction mode and update mode for the command class to control commands [Transaction(TransactionMode.Manual)], [Regeneration(RegenerationOption.Manual)] Using the API requires the use of the Application class and the Document class. Application classes are UIApplication and Application. UIApplication is used to provide access to UI-level interfaces, including the ability to access the user interface- RibbonPanels, get active documents for the user interface, etc. Application is used to provide access to other application-level content interfaces. The document classes are UIDocument and Document. UIDocument is used to provide access to UI-level interfaces and Document is used to provide access to other application level content interfaces (Fig. 1-8). Figure 1-8 Add-In Manager Sector 15 1.2.3 Simple Example Reading the building material names, one of the plug-in functions is achieved by writing the ReadElementMaterials command (Fig. 1-9) Figure 1-9 Read Element Materials Part of Codes for ReadElementMaterials: private static IEnumerable<CarbonEmissionItem> ReadElementMaterals(Element element, IEnumerable<UnitCarbonEmissionModel> units, string typeName) { Document document = element.Document; List<CarbonEmissionItem> items = new List<CarbonEmissionItem>(); var materialIds = element.GetMaterialIds(false).ToList(); 16 for (int i = 0; i < materialIds.Count; i++) { CarbonEmissionItem item = new CarbonEmissionItem(); item.TypeName = typeName; ElementType roofType = document.GetElement(element.GetTypeId()) as ElementType; item.FamilyName = roofType.FamilyName; item.SymbolName = roofType.Name; bool custom = false; double cO2eMass = 0; var materialId = materialIds[i]; Material material = document.GetElement(materialId) as Material; Some materials use metric units for each unit of CO2 emissions, to prevent conflicts with Revit software that uses imperial units, appropriate code to convert the units is needed (Fig. 1-10). 17 Figure 1-10 Unit Conversion Part of Codes for Unit Conversion: public class UnitCarbonEmissionEditViewModel:ViewModelBase { public UnitCarbonEmissionEditViewModel(bool isSlide,IEnumerable<string> groups) { IsSlide = isSlide; Groups = groups; Initilized(); } public UnitCarbonEmissionEditViewModel(UnitCarbonEmissionModel model, IEnumerable<string> groups) 18 { Model = model; Groups = groups; IsSlide = model.MaterialDefinition.Unit != null&& !string.IsNullOrEmpty(model.MaterialDefinition.Unit.Key); Initilized(); } 1.2.4 An Example of A Plug-in for Revit for Architecture Hundreds of plug-ins, if not more, have been developed for Revit; some are for form generation, others for documentation tasks like standardizingfoness; others do some sort of analysis. One example is One Click LCA. The One Click LCA plug-in can conclude a life cycle assessment of a building by analyzing the current building model. During this process, the plug-in can be automatically connected to an Internet cloud service center to accurately, efficiently, and instantly read the materials used in the building model and finally perform calculations and evaluations (Fig. 1-11-1). One Click LCA classifies the types of construction materials read into foundations, framing, etc., and includes in each category a series of parameters for Resource, Quantity, Profile, Comment, Thickness, Transport, and Service Life (Fig. 1-11-2). (One Click LCA | Revit | Autodesk App Store, n.d.). 19 Figure 1-11-1 One Click LCA Visualization (One Click LCA | Revit | Autodesk App Store,n.d.) Figure 1-11-2 One Click LCA Sample Result Output (Grimm, 2016) 1.3 Carbon Neutrality (Carbon Offset) Design Carbon neutrality (carbon offset) can be used as a criterion for assessing low-carbon 20 design. Carbon neutrality is a term used to describe the reduction of energy consumption, and it refers to the total amount of carbon dioxide or greenhouse gas emissions directly or indirectly produced by a country, enterprise, product, activity, or individual within a certain period, which can be offset by afforestation, energy conservation, and emission reduction to achieve positive and negative offset and relatively "zero emission" (Wikipedia, 2021). Net zero refers to the gradual decrease of gross GHG emissions and the gradual decrease of the net GHG emissions curve, resulting in less and less carbon offsetting, and thus the gradual increase of neutralization, eventually reaching zero (Fig. 1-12. And carbon-neutral refers to gross GHG emissions keep developing steadily, but the carbon offset also grows or decreases together with the gross GHG emissions, so a carbon- neutral state can always be reached (Fig. 1-13). 21 Figure 1-12 Corporate Net-Zero (Net-Zero vs. Carbon Neutrality, n.d.) Figure 1-13 Corporate Carbon Neutrality (Net-Zero vs. Carbon Neutrality, n.d.) 22 1.3.1 Carbon Offset Global warming is a consequence of human actions that cause climate change on Earth (Are Humans the Major Cause of Global Warming? | Union of Concerned Scientists, 2022). Carbon is a natural resource made up of carbon, such as oil, coal, and wood. In the modern era, carbon is consumed more, and carbon dioxide, a known culprit of global warming, is produced more. With human activities, global warming is also affecting the way people live and is causing direct and indirect problems with the weather and ecosystems on Earth. Carbon peak refers to the stage when carbon emissions enter a plateau and then enter a steady decline. Together with carbon neutrality, carbon peaking is referred to as "double carbon" (Saunois et al., 2020). The process of carbon neutrality is generally divided into six steps. The first step is to set a commitment. Either as a company or as a country setting carbon neutrality is the ultimate goal. In the second step, calculations and analysis are done to calculate the existing carbon emissions and to show how they can be reduced. The third step is implementation, where companies or governments introduce projects that require carbon neutrality into their local environmental and energy management systems. The fourth step is to reduce and account for the reduction. The reduction of greenhouse gas emissions is achieved through a series of tools and changes. For example, by planting trees to absorb carbon dioxide and using low-carbon materials to achieve low-carbon goals. The fifth step is offsetting, through the carbon offsetting mechanism, to calculate 23 the carbon emission reduction through a series of measures to offset the carbon emission caused by itself. The final step is to periodically evaluate the results, compile and verify how it was implemented, and summarize and improve the measurements to reduce carbon emissions(What Is Carbon Neutrality and How Can It Be Achieved by 2050? | News | European Parliament, 2022b). 1.3.2 Embodied Carbon vs. Life Cycle Carbon In the building domain, embodied carbon refers to the carbon emissions generated during the extraction and processing of building materials, construction, transportation, assembly, maintenance, and disposal of building materials at the construction site. In contrast, life cycle carbon refers to the carbon emissions generated during the operational phase of a building due to its energy consumption (Fig. 1-14) (1 - Embodied Carbon 101 - Carbon Leadership Forum, 2022). 24 Figure 1-14 Corporate Carbon Neutrality (MCARLETON, 2022) 1.3.3 Similar Software Several software programs can calculate the carbon offset. The tables were summarized and processed according to a series of parameters such as the degree of coverage of the identification of building materials, the influence of the environment, the ability to identify in the Revit material library, the ability to calculate embodied carbon and operational carbon, and the range of data and rates (Fig. 1-15). 25 Figure 1-15-1 Carbon Software and Tools Matrix (1) (See Appendix A for a larger table) Figure 1-15-2 Carbon Software and Tools Matrix (2) (See Appendix A for a larger table) 26 Figure 1-15-3 Annotation of A1-A5, B1-B5, C1-C5 Figure 1-15-4 Annotation of P1-P15 27 1.3.3 Government Regulations on Low Carbon China has set targets, policies, and regulations to promote low-carbon development, including a goal to peak carbon emissions before 2030 and achieve carbon neutrality by 2060. The country has established a carbon emissions trading market, promoted renewable energy, and implemented regulations to reduce emissions from industries (An Energy Sector Roadmap to Carbon Neutrality in China – Analysis - IEA, n.d.). In the United States, the government has implemented various regulations to promote low-carbon development and reduce greenhouse gas emissions, such as the Clean Air Act and tax credits for renewable energy production. The US has set a goal to reach net-zero emissions by 2050 and has re-joined the Paris Climate Agreement (F ACT SHEET: President Biden Sets 2030 Greenhouse Gas Pollution Reduction Target Aimed at Creating Good-Paying Union Jobs and Securing U.S. Leadership on Clean Energy Technologies | The White House, n.d.). (1) US government Regulations and Voluntary Measures Since the enactment of the Buy Clean California Act in 2017, the first statewide policy to address embodied carbon in certain building materials, the United States has been working to reduce embodied carbon. Most buildings with materials such as steel and glass are required to disclose carbon emissions data. On September 16, 2022, California signed AB 2446 into law, adding to the growing list 28 of state policies that address embodied carbon problems. AB 2446, based on California's strategy to address embodied carbon, required the Air Resources Board to develop a framework for measuring and reducing the intensity of average carbon emissions from building materials by July 1, 2025, to achieve a net 20 percent reduction by 2030 and a net 40 percent reduction in greenhouse gas emissions from building materials by 2035. Most importantly, the law requires that the framework includes significant requirements for builders and manufacturers including the provision that for new construction of five or more residential units over 10,000 square feet (non- residential), the project team must submit a life-cycle assessment, including the carbon intensity of the materials used. Manufacturers must also submit environmental product claims for building materials that meet specified criteria (New California Law Addresses Embodied Carbon | U.S. Green Building Council, 2022). Many companies and owners have made voluntary commitments to reduce their implied carbon in the context of green building policies (3 - Targeting Net-Zero Embodied Carbon - Carbon Leadership Forum, 2022), such as • Amazon. Amazon co-founded The Climate Pledge, which is a commitment to net-zero carbon across their business by 2040. • Autodesk. Autodesk aims to achieve climate-neutral GHG emissions for scopes 1, 2, and 3 beginning in FY21 using an internal carbon price. Their target is to achieve an 85% reduction by 2050. 29 • Microsoft. Microsoft aims to drive its operations and supply chain to be carbon- negative by 2030. • Nike. Nike aims to reduce their carbon footprint by 2030, with an absolute reduction of Scope 1 and 2 emissions by 65% and Scope 3 emissions by 30%. • LinkedIn. LinkedIn aims to reduce its scope 3 emissions by more than half and remove more carbon than they emit by 2030(CLF Embodied Carbon Toolkit for Building Owners - Carbon Leadership Forum, 2022). (2) China Government Regulations and Voluntary Measures China's low-carbon development policy ‘I ’ is mainly guided and planned in terms of production, distribution, consumption, infrastructure, and green technology (China’s Transition to a Low-Carbon Economy and Climate Resilience Needs Shifts in Resources and Technologies, n.d.). 1. From production to distribution, developing green low-carbon cycle 2. Encourage the consumption of green and low-carbon products 3. Promote green and low-carbon technology innovation China has implemented Assessment Standard for Green Building in 2019. The main contents of the standard are the following (GB/T 50378-2019): 1. Reconstructed the green building evaluation technical index system; 30 2. Adjusted the evaluation time node of green building; 3. Increased the green building grade; 4. Expanded the green building connotation; 5. Improved the green building performance requirements. Among them, the standard provides scoring standards and grades corresponding to different scores for safety and durability, health and comfort, the convenience of life, resource conservation, and environmental livability of buildings, to judge green buildings (GB/T 50378-2019). 55.5% of companies in China have volunteered to carry out low carbon emission reduction initiatives, targeting how to make a low carbon transition, using digital science to make a low carbon transition, and increasing efforts to promote a low carbon transition (Executive Summary – An Energy Sector Roadmap to Carbon Neutrality in China – Analysis - IEA, n.d.). 1.4 Carbon Trading, Carbon Emission, and Embodied Carbon Carbon trading is a collective term for greenhouse gas emission rights trading. Among the six greenhouse gases required to be reduced by the Kyoto Protocol, carbon dioxide is the largest, and therefore, greenhouse gas emission rights trading is calculated in terms of each ton of carbon dioxide equivalent (Baidubaike, 2021). Under the premise of total emission control, GHG emission rights, including CO2, become a scarce 31 resource and thus have commodity properties (Fig. 1-16). Figure 1-16 How Carbon Trading Works (What Is Carbon Trading? How Did It Come About? | by Sabrina Lerskiatiphanich | Carbonbase | Medium, 2022) Foresters provide credit for CO2 sequestration through the efficient management of forestry trees, which are sold to companies that produce greenhouse gas. These companies have to pay foresters to get permitted credits to compensate for their carbon emissions (Fig. 1-17). 32 Figure 1-17 Carbon Market (Carbon Trade - CarbonFinance.IN, n.d.) 1.4.1 Carbon Trading The basic principle of carbon trading is that one party to a contract receives greenhouse gas emission reductions by paying the other party, and the buyer can use the purchased emission reductions to mitigate the greenhouse effect and thus achieve its goal of reducing emissions. Carbon dioxide (CO2) is the largest of the six required greenhouse gas reductions; it is measured in tons of carbon dioxide equivalent (tCO2e) and is commonly referred to as carbon trading. For example, if the factory emits 1000t CO2e this year, then the factory has to buy a credit equivalent to 1000t CO2e from the sector that sells carbon credit, such as the forestry sector, and this is the trading market is called the carbon market. (What Is Carbon Trading? How Did It Come About? | by Sabrina Lerskiatiphanich | Carbonbase | Medium, 2022). As usual, a broadleaf forest located near the equator can absorb 1 ton of CO2 per hectare per day. For embodied carbon of regular buildings, the CO2 emissions in the construction materialization stage are 326.75 kg - CO2/m 2 on average. For embodied carbon of super-high-rise buildings, the CO2 emission is 1.5 times larger than that of multi-story buildings (Luo, 2015). 33 The economics of carbon trading is to encourage enterprises with a lower cost of reducing carbon emission to exceed their emission reduction targets, and the excess emission reduction credits will be sold as carbon credits to enterprises with poor emission reduction results or higher cost of reducing carbon emission that cannot achieve the corresponding emission reduction targets. This will then help the latter to achieve the set emission reduction targets and effectively reduce the cost of emission reduction to achieve the targets (What Is Carbon Trading? How Did It Come About? | by Sabrina Lerskiatiphanich | Carbonbase | Medium, 2022). 1.4.2 US Standard of Carbon Emission and Embodied Carbon The General Specification for Energy Conservation and Renewable Energy Utilization in Buildings was launched to implement national laws and regulations on energy conservation, ecological environment protection, and climate change, to implement carbon peaking and carbon neutral decision-making, to improve energy resource utilization efficiency, to promote renewable energy utilization, to reduce building carbon emissions, to create a good building indoor environment and to meet the needs of high-quality economic and social development (GB 55015-2021). The specification plays an important role in improving the quality of construction and promoting high-quality development and green development of the construction industry. The specification highlights the nature of technical regulations and clarifies 34 the mandatory indicators and basic requirements for design, construction, commissioning, acceptance, and operation management from three aspects: energy- saving design of new buildings, energy-saving of existing buildings, and utilization of renewable energy (Reeder, 2011). 1.4.3 China Standard of Carbon Emission and Embodied Carbon China has implemented a number of regulations and standards aimed at reducing carbon emissions and promoting sustainable development. One of the key measures is the China National Emission Standard for Stationary Sources (GB 13223), which sets out limits for the emissions of various pollutants, including carbon dioxide (CO2), from stationary sources such as power plants and factories. The standard is regularly updated to reflect advances in technology and changes in environmental priorities. In addition to this, China has also established a system for monitoring and reporting carbon emissions, known as the National Greenhouse Gas Inventory System. This system is used to track emissions across different sectors of the economy and to support policy-making related to climate change. With regards to embodied carbon, China has not yet established a specific standard or regulation. However, there are a number of initiatives underway to measure and reduce embodied carbon in buildings and other infrastructure. For example, the Green Building Evaluation Standard (GB/T 50378) includes a section on embodied energy, which aims 35 to promote the use of low-carbon materials and reduce the environmental impact of building construction. Overall, China is taking significant steps to address carbon emissions and promote sustainable development, and is likely to continue to play a key role in global efforts to mitigate climate change. 1.4.4 The Difference Between US and China Standard of Embodied Carbon The US and China have different approaches to calculating energy usage and embodied energy, which can be attributed to their varying energy policies, economic structures, and cultural values. One of the main differences is their energy mix, with the US relying more on petroleum, natural gas, and coal, while China is more heavily dependent on coal. As a result, the energy intensity of China's economy is generally higher than that of the US. Another difference is their economic structures, with the US having a more service- oriented economy and China having a more manufacturing-based economy. This leads to a higher demand for energy-intensive manufacturing processes in China, potentially resulting in higher embodied energy for certain products. Environmental regulations also differ between the two countries, with the US having 36 stricter regulations than China. This could lead to different calculations of embodied energy for certain products. Cultural values and attitudes towards energy efficiency are also a factor. The US places a strong emphasis on individualism and personal responsibility, which may lead to greater adoption of energy-efficient practices. In contrast, China values collective welfare and may prioritize policies that support energy security and industrial growth. Overall, while both the US and China recognize the importance of energy efficiency, renewable energy, and embodied energy in reducing overall energy consumption and addressing global energy challenges, their different energy mixes, economic structures, environmental regulations, and cultural values can result in different approaches to calculating energy usage and embodied energy. 1.5 Building Materials and Tree CO 2 Databases Building materials are various materials applied in construction projects. There are many types of construction materials, which are roughly divided into (1) inorganic materials, which include metal materials (including ferrous and non-ferrous materials) and non-metallic materials (such as natural stone, burnt earth products, cement, concrete, and silicate products, etc.). (2) organic materials, which include plant material, synthetic polymer materials (including plastics, coatings, and adhesives), and asphalt 37 materials. (3) Composite materials, which include asphalt concrete, polymer concrete, etc., are generally made of inorganic non-metallic materials and organic materials composite (Types of Building Materials Used in Construction, 2022). The process of carbon solidification and carbon release by photosynthesis and respiration of trees is relatively balanced under certain conditions, but trees will grow, so the whole process is relatively larger in terms of carbon dioxide absorption than carbon dioxide release. By planting new trees and protecting them from destruction, carbon dioxide is continuously absorbed and solidified into itself, which has the effect of reducing greenhouse gases. Building a large database of trees helps to give users more options to plant different kinds of trees. Since buildings are located in different climate zones, the tree database can contain trees from each climate zone for users to choose from. 1.5.1 Database of Embodied Cardon in Building Materials Building materials have many branches and classifications due to their use, location, aesthetics, durability, etc., which makes it important and hard to obtain a thorough and complete library of building materials. It is essential to create a digital database to collect information about the materials embodied carbon, which will give each building material a label and allow for subsequent indexing and calculations. This digital database should be frequently enriched and updated to encompass and cover a wider 38 range of materials, especially composite components which, by their nature, have a wide variety of branches from the same material. 1.5.2 Database of Embodied Carbon in Trees Although planting trees is not the only method of sequestering carbon, it can be a useful one. The carbon absorption of surrounding landscape plants is defined as the average of the carbon uptake of trees in IECC climate zone for one year based on the current building location division so various uncertainties affecting plant growth processes may lead to unstable carbon absorption values for individual groups. These uncertainties include the climate and the effects of human activities on carbon uptake by plants in the surrounding landscape. For example, broadleaf trees can absorb 730kg CO2e in IECC climate zone 2 (Fig 1-18). The IECC (International Energy Conservation Code) climate zone map and the USDA (United States Department of Agriculture) climate zone map are two different systems used to classify climate zones in the United States. The main difference between the two is their purpose: the IECC climate zone map is used for building construction and energy codes, while the USDA climate zone map is used for gardening and plant selection. Additionally, the IECC climate zone map takes 39 into account both heating and cooling degree days, while the USDA climate zone map is primarily based on average annual minimum temperature. Figure 1-18 IECC Climate Zone Map (International Energy Conservation Code, 2012) 1.6 Summary Chapter 1 introduced building information modeling, the Revit API, carbon neutrality (carbon offset) design, carbon trading, carbon emission, embodied carbon, building materials, and tree CO2 databases. BIM allows for parameters associated with objects (such as material), the ability to take 40 off quantities (such as cubic feet of concrete), and the capacity to use the API to create new tools (creating a plug-in). External databases such as embodied carbon and tree values can be added. A plug-in developed through Revit API can read the material details of the current building and calculate the total embodied carbon of the building, which can be combined with the carbon emission of the building operation throughout the year to get the total carbon emission of the building. Chapter 2: Literature Review This section discusses embodied carbon and operational carbon, carbon accounting as a critical methodology in embodied carbon estimation, methodology for carbon neutrality, carbon trading with different standards, tree database with sequestration, and Revit API development. According to the U.N. report, the global warming crisis is mainly due to excessive carbon emission during construction, production, etc. (Climate Reports | United Nations, 2022). While carbon emission is critical to consider in transportation, building operation, etc, embodied carbon is frequently missed in whole carbon emission estimation because building material has the characteristics that the surface has low carbon but has high hidden carbon (Liu et al., 2020). 41 2.1 Embodied Carbon and Operational Carbon Embodied carbon refers to the carbon dioxide emissions of building materials in buildings and their corresponding construction processes throughout their life cycle. It is the sum of the total carbon emissions of the building before it is put into operation, and demolition, transportation, and recycling at the end of its life cycle. The key point is that it includes the carbon emissions from the extraction, transportation, manufacture, and placement of the building materials on site. Global embodied carbon emissions account for 11% of global greenhouse gas emissions and 28% of total building sector emissions each year. Embodied carbon is expected to account for half of the carbon emissions from new technology buildings in the next 20-30 years(Embodied Carbon in Construction Calculator (EC3) - CarbonCure, n.d.). Operational carbon refers to the process of generating carbon emissions during the operation and uses the phase of a building, i.e., from the time it is built and put into use until the end of its life cycle, so it also includes the management and maintenance of building materials, structures, and some components (Embodied Carbon in Construction Calculator (EC3) - CarbonCure, n.d.). The building life cycle has four stages that contribute to the overall carbon emissions (Fig. 2-1). For the product stage, the cradle-to-gate concept of material or product manufacturing refers to the emissions resulting from the production of building materials, products, and components, from the extraction, cutting, processing, and refining of materials, the transportation of goods and the energy consumed in a range 42 of production. The CO2 generated throughout this process is called embodied carbon. For the construction process stage, the carbon emissions are mainly reflected in the movement of materials in and out, installation and dismantling, earth excavation works, assembly works, and remediation works. For the use stage, carbon emissions are mainly reflected in the building's indoor heating, ventilation system, lighting system, and air conditioning CA V system. Carbon emissions from the operational phase of a building account for 75% of the building's lifecycle carbon emissions, depending on how long the building is in use. Also, the carbon emissions from maintenance, repair, and renovation during the operation phase of a building are considered operational carbon. For the end-of-life stage, carbon emissions are mainly generated after the building is no longer in use, during the process of demolition of building materials, transportation of waste, disposal of waste, and recycling of waste. Beyond building life cycle stages, modular analysis of the entire life cycle of the building structure helps to implement the design concept of recovery, reuse, and recycling, which can reduce energy consumption to a certain extent (RICS Methodology to Calculate Embodied Carbon of Materials, 2012). Figure 2-1 Carbon life cycle phases of a building 43 (RICS Methodology to Calculate Embodied Carbon of Materials, 2012) Although embodied carbon and operational carbon are not the same, they together constitute the carbon emissions during the entire life cycle of a building before use: transportation of materials, construction process, etc., after use: maintenance carbon emissions of the building during the operational phase, and after disposal: dismantling, transportation, and recycling. The calculation of embodied carbon is based on the ability to know the material type and the corresponding volume of the material being used. Then one can calculate the embodied carbon of the building and compare it to existing standards and best practices. As previously mentioned, the building life cycle stages for embodied carbon calculation cover the product stage, construction process stage, and end-of-life stage. 2.2 Carbon Accounting as a Critical Methodology in Embodied Carbon Estimation Carbon accounting is defined as measuring how much carbon dioxide equivalents will an organization or developers emit through the entire construction process of buildings. Countries, companies, and individuals use it to make a profit from the carbon credit that can be traded on the carbon market. Carbon accounting is considered a measure of sustainable measurement (Schaltegger & Csutora, 2012). 44 A large and growing share of GHG emissions in Europe and the United States is embedded in imported goods as "carbon backpacks" which means imported products often include a lot of embodied carbon (Weizsacker, 2009). In addition, the carbon dioxide intensity of products is often more than expected, partly as a result of more long-distance transportation. As a result, the national carbon accounts of developed and developing countries are distorted in terms of who causes carbon emissions and bears the associated responsibility (Bastianoni, 2004). The large and growing share of GHG emissions in imported goods highlights the importance of accounting for carbon emissions and impacts in the supply chain and product lifecycle, including emissions from semi-manufactured goods imported by manufacturing. In buildings, GHG emissions might be indoor heating or cooling of air conditioners, hot water supply for indoor bathrooms and toilets, natural ventilation systems, indoor and outdoor lighting, and HFC and PFC gases generated during air conditioning (Röck et al., 2020). Given that energy systems, product designs, and various production processes are major direct and indirect sources of carbon emissions, companies have a particular responsibility to reduce the life-cycle emissions of their products and services on a global scale. Greenhouse gases are different from local pollution in terms of technological control possibilities. End-pipeline technologies, such as ESP, scrubbers, carbon capture, and storage, are not technically or economically viable solutions to curb 45 GHG emissions (Gibbins and Chalmers, 2008). Current GHG reduction targets focus on improving process efficiency and efficient consumer products. This is an important area of activity, however, at present strong global population growth and economic growth, especially in large developing countries, outweigh efficiency gains. The challenge for carbon accounting is therefore how to support radical reductions in total carbon impacts that exceed efficiency gains. In the construction industry, carbon labeling of products and life cycle costing is a more comprehensive and established approach. The triad of consumer, product, and supply chain generates relevant accounting methods. For example, in the EU's environmental policy, the production of building materials and products takes into account industrial emissions as well as disposal, which involves the entire life cycle of building materials. This kind of policy ensures a comprehensive solution for construction (EC, 2007). The European Commission has developed a common standard ‘Environmental product declarations (EPD) since 2012 (Durão et al., 2020). EPD-compliant products and services are guaranteed not to have a significant impact on the surrounding environment, and EPD shows the commitment to products made by manufacturers in a very transparent way. The EPD allows for the comparison of transparent, objective data, allowing buyers to compare the environmental performance of individual products (EPD International, 2022). 46 Carbon management is becoming a brand new, far-reaching, and integrated management function to help corporations, enterprises, institutions, and developers achieve significant carbon reduction. Carbon management by companies requires them not only to comply with regulations and respond to social pressures and potential market changes but to set up arrangements to reduce carbon emissions as well (Andrews and Cortese, 2011). According to China Life Cycle Database, the data shows that the carbon footprint of the building is 2993 kg CO2e/m2 on average. The operation phase accounts for 69 percent of total GHG emissions while building material production accounts for 24 percent. Concrete is the most used building material, accounting for 82% of the mass, but only 44% of material-related GHG emissions. While steel and aluminum account for only 2.6% and 1.4% of the mass, they contribute 28% and 17% of GHG emissions, respectively (Xining Yang, et al. 2018). In this way, the carbon accounting and potential life cycle performance of buildings can be assessed, which makes carbon accounting not only accessible but more portable to lead the users to do the low carbon design. Net Zero platform provides three main approaches to doing carbon accounting in the US. They can be summarized as Spend-base data, Activity-base data, and The hybrid methodology. (Carbon Accounting Methodologies for Measuring Emissions - Net0, 2022) 47 Spend-based data is an index based on the price of products, materials, etc. purchased or consumed multiplied by a specific emission factor. The emission factor is determined by the average emission level from the national industry. This data is not environmentally accurate because it is more focused on the price of the product, material, etc., but usually has a wide range. It also completely ignores the differences between manufacturers and products. Activity-based data is more focused on collecting data on products and materials throughout the whole supply chain at a detailed level. The initial data is recorded and quantified into emissions data based on the activities of an organization, a company, or a project. The more the database is accumulated, the more accurate the carbon accounting will be. The hybrid methodology is a combination of the above two and is the most commonly used and recommended method. This method collects as much data as possible from the second method and then uses the first method to estimate the remaining data (Carbon Accounting Methodologies for Measuring Emissions - Net0, 2022). 2.3 Methodology for Carbon Neutrality The most commonly used methods for measuring implied carbon are Life Cycle Assessment (LCA) and the Global Warming Potential (GWP) (Input-Output Model (I- O) – Knowledge Base, n.d.). EPDs (Environmental Product Declarations) are being 48 developed to provide data about product carbon footprints. 2.3.1 Life Cycle Assessment (LCA) The Life Cycle Assessment (LCA) measures carbon dioxide emissions throughout the life cycle of a product, including direct carbon emissions from production, carbon emissions contained in raw materials and intermediate products, etc. It allows detailed estimation of carbon emissions contained in products, and the method is based on the implicit carbon measurement of products. LCA is a bottom-up approach that can provide more specific information to decision-makers. It is difficult and less feasible to use the LCA method to measure the implied carbon because of the complicated data integrity requirements and the complicated calculation process, as there are many related databases and different statistical calibers (Muralikrishna & Manickam, 2017). 2.3.2 The Global Warming Potential (GWP) GWP compares how much gas contributes to global warming. It is generally based on one ton of CO2 emissions to determine how much energy is absorbed by the emissions of one ton of a particular gas compared to one ton of CO2 emissions. Among conventional building materials, steel is widely used because it is very strong and has high tensile strength. Concrete is strong and durable, and comes in a variety of types with less embodied carbon than steel. However, by GWP, it can be found that 49 structural stone with a lower GWP value can replace concrete and steel. The GWP value of cubic stone (135 kg CO2/m 3 ) is 45-75% lower than that of concrete (246-514 kg CO2 /m 3 ) and more than 99% lower than that of steel (22,294-29,202 kg CO2/m 3 ). Better materials can be found by comparing GWP values, and the GWP approach is faster and more immediate than LCA, which usually covers the whole life cycle of a building. 2.3.3 EPDs (Environmental Product Declarations) EPDs show that specific products have committed to protecting the environment and reducing the environmental impact of the product throughout its life cycle by providing detailed information and reports on the product for the convenience of the buyer (Fig. 2-2). Because of their impartiality, objectivity, and accuracy, EPDs are often used to evaluate the environmental performance of a product. They are developed by International Organization for Standardization (ISO) 14025 and published in the International EPD system (EPD International, 2022). 50 Figure 2-2 A Sample EPD for a Concrete Mix Design by Central Concrete Supply Co. (Environmental Product Declarations And Product Category Rules - References - Sustainable Pavement Program - Sustainability - Pavements - Federal Highway Administration, n.d.) 2.4 Carbon Trading The carbon trading market is mainly divided into two aspects: one is the analysis of the operation of the carbon trading market, and the other is the analysis of the spillover effect between the carbon trading market and related markets (Zhao et al., 2023). Most of the investigation on the operation of the carbon trading market is to analyze the effect of carbon emission reduction; Few scholars have discussed the liquidity or volatility of carbon trading market operation. The difference and synthetic control methods are mainly used to compare and analyze the situation before and after the launch of the carbon trading market to find evidence that the establishment of the carbon trading market can effectively reduce carbon emissions. Compared to difference method, the synthetic control method is generally considered to be more accurate than the difference method as it takes into account other factors that may influence emissions. However, the difference method is more commonly used in carbon trading, as it is easier to understand and implement. Therefore, both the difference and synthetic control methods have their advantages and disadvantages when it comes to carbon trading. The choice of method will depend on the specific circumstances of the project or activity 51 and the requirements of the carbon trading program being used. (Dong et al., 2020). Carbon trading can be an effective way to reduce greenhouse gas emissions, but its success depends on the way it is designed and implemented. While carbon trading can be complex and subject to market volatility, it can also create economic opportunities and complement other policies aimed at reducing emissions. 2.4.1 The US Regional Greenhouse Gas Emission Standard The Regional Greenhouse Gas Initiative (RGGI) is the first mandatory greenhouse gas emissions trading program in the United States. RRGI was officially established in 2005 and began operations in 2009. RGGI is a cap and trade program, but it only covers the power sector. For 2022, the cap of RGGI for the twelve states that participated is 156 million CO2 allowances, which represents the budget of this certain region for CO2 emissions (Elements of RGGI | RGGI, Inc., 2022). For trade programs, power plants can purchase allowances through auctions or by participating in CO2 offset programs (NJDEP | Regional Greenhouse Gas Initiative (RGGI) | Air Quality, Energy and Sustainability (AQES), 2022). They set regional caps on carbon dioxide emissions from fossil-fuel power plants (25 megawatts or more), requiring them to have a tradable carbon dioxide allowance for every ton of carbon dioxide they emit. A total of 209 power plants are included in the scheme. The cap was initially set at 188 million (short) tons of carbon dioxide emissions 52 for the 2009-2014 period. Starting in 2015, the cap will be reduced by 2.5 percent a year, for a total reduction of 10 percent by 2018, which will lead to a planned and predictable decrease in CO2 emissions (RGGI, 2010). RGGI consists of a separate carbon dioxide budget trading scheme for each of the 10 participating states. Through separate regulations based on the RGGI model rules, each state's CO2 budget trading program limits CO2 emissions from power plants, issues CO2 allowances, and determines participation in regional CO2 quota auctions. Emission allowances are allocated through auctions. In total, RGGI states choose to sell about 90 percent of their carbon dioxide allowances through quarterly regional auctions. Proceeds from the RGGI CO2 quota auction have been invested in schemes to improve terminal energy efficiency and accelerate the deployment of renewable energy technologies, with about 70 percent of auction proceeds currently invested in this. In addition to trading emissions allowances, RGGI allows for a variety of flexible mechanisms to ensure successful compliance with the cap. Emissions "offsets" are one such mechanism. In the case of RGGI, offsets represent project-based GHG reductions or carbon sequestration achieved outside the capped power sector. RGGI limits the award of offsetting allowances to five project categories, each designed to reduce or sequester emissions of three greenhouse gases: carbon dioxide (CO2), 53 methane (CH4), and sulfur hexafluoride (SF6). Currently, RGGI's five eligible offset project categories include the following methods: • Capture or destroy CH4 from landfills • Reduce SF6 emissions from power transmission and distribution equipment. • Sequestration of carbon dioxide through afforestation • Reduce carbon dioxide emissions through energy efficiency in the use of non- electric terminals in buildings; • Avoidance of CH4 emissions through agricultural manure management practices (Offsets | RGGI, Inc., 2022) All offset projects must be located in one of the RGGI participating states. Other eligible offset types may be added in the future. RGGI participating states currently allow regulated power plants to use qualified offsets to meet their 3.3 percent CO2 compliance obligations. This amount could be expanded to 5 percent and 10 percent if CO2 quota prices reach the $7 and $10 per quota threshold, respectively (Offsets | RGGI, Inc., 2022). RGGI has grown into the most important carbon market in North America, trading 805 million metric tons of carbon dioxide equivalent in 2009, its first full year of operation, for a total value of nearly $2.2 billion. This represents a 10-fold increase in volume and value over 2008 (pre-market) activity. With RGGI allowances trading at an average 54 price of US $3.3 per tonne of CO2 equivalent during 2009 (or substantially below the EU quota), this is an overallocated market that is likely to continue for many years unless the ceiling is modified (Kossoy & Ambrosi, 2010). 2.4.2 Methodology for Carbon Trading The North American carbon trading system consists primarily of local and regional carbon trading systems in several states in the United States and several provinces in Canada. Although there is no federal carbon trading policy in the U.S., local initiatives are more active, and carbon trading systems have emerged, initiated by some states or companies, to limit greenhouse gas emissions and encourage innovative energy technologies and green jobs, among which RGGI and California ETS are the most influential (Carbon Pricing Dashboard | Up-to-Date Overview of Carbon Pricing Initiatives, n.d.). The U.S. power plants account for about 40% of the nation's CO2 emissions, so controlling carbon emissions from the power sector is critical. The Regional Greenhouse Gas Reduction Initiative (RGGI) is one of the U.S. local governments' initiatives to reduce emissions in the electric power sector using market mechanisms. It covers 10 states in the northeastern U.S., to reduce CO2 emissions from the electric power sector by 10 percent from 2009 levels by 2018, and by 10 percent from 2009 levels by 2015. Emissions from the electric power sector by 10% from 2009 levels by 2018, 50% by 2020 relative to 2005 levels, and 30% by 2030 relative to 2020 levels. 55 Proceeds from the auctions are used for various programs such as energy efficiency improvements, end-user subsidies, renewable energy technologies, emission reduction, and adaptation programs (Regional Greenhouse Gas Initiative (RGGI) - Center for Climate and Energy SolutionsCenter for Climate and Energy Solutions, n.d.). 2.5 Tree Database with Sequestration Relying on afforestation to absorb and sequester CO2 and carbon offsetting to reduce carbon payments is one way to reduce the amount of carbon purchased by certain projects, companies, or enterprises. Tree growth rates vary by species and size, and there are different methods for accounting for how much carbon trees can sequester. There are many methods for this. Three different models currently available to predict the carbon sequestration of trees are (1) i-Tree Streets, (2) Urban Tree Databases (UTD), and (3) combines empirically measured growth rates and UTD (Boukili et al., 2017). The nine most abundant tree species in Cambridge, Massachusetts is selected for estimation (Fig. 2-2): Species N(% all street trees) Range of diameter values (cm) CO2 sequestration estimate (kg y −1 ) i-Tree UTD Empirical + UTD 56 Acer platanoides 2207 (16.4) 2.54– 106.68 315,480 139,858 56,190 Acer rubrum 1225 (9.1) 2.54– 81.28 39,278 29,957 13,684 Gleditsia triacanthos 1543 (11.4) 2.54– 96.52 77,682 123,991 75,231 Platanus x acerifolia 386 (2.9) 2.54– 83.82 15,225 13,342 7,013 Pyrus calleryana 1025 (7.6) 2.54– 60.96 82,532 62,778 25,203 Quercus palustris 911 (6.7) 2.54– 134.62 175,322 219,118 137,935 Quercus rubra 330 (2.4) 2.54– 132.08 30,773 38,252 45,299 Tilia cordata 954 (7.1) 2.54– 109.22 42,156 51,526 23,936 57 Zelkova serrata 319 (2.4) 2.54– 60.96 14,501 12,083 5,564 Total 8900 (65.9) 792,950 690,913 390,053 Figure 2-2 9 Street Trees Sequestration Using 3 Different Models (Boukili et al., 2017) Another method is to calculate the mass of trees for carbon sequestration which contributes to carbon accounting. The rate of carbon sequestration depends on many factors like types, growing conditions, and density. The algorithm to calculate the weight of a tree is: W={ 0.25𝐷 2 𝐻 (𝐷 < 11) 0.15𝐷 2 𝐻 (𝐷 ≥ 11) Where, W = Above-ground weight of the tree in pounds D = Diameter of the trunk in inches H = Height of the tree in feet And use a chemical formula to calculate the carbon decomposition (How to Calculate the Amount of CO2 Sequestered in a Tree per Year, n.d.): 58 (1) The atomic weight of Carbon is 12.001115. (2) The atomic weight of Oxygen is 15.9994. (3) The weight of CO2 is C+2*O=43.999915. (4) The ratio of CO2 to C is 43.999915/12.001115=3.6663. Therefore, to determine the weight of CO2 sequestered in the tree, multiply the weight of carbon in the tree by 3.6663. The average carbon content is 50% of the tree’s total volume in general. The weight of the root of a tree roughly takes up 20% as much as that of the above- ground weight of the tree. So the total green weight of a tree= 120% of × the above- ground weight of a tree. The tree is composed of 72.5% dry mass and 27.5% moisture on average. So dry weight of a tree= 72.5% × total weight of a tree (How to Calculate the Amount of CO 2 Sequestered in a Tree per Year, 2022). Therefore, for example: W={ 0.25𝐷 2 𝐻 (𝐷 < 11) 0.15𝐷 2 𝐻 (𝐷 ≥ 11) Where: W × 120% =1.2W (total green weight) 1.2W × 72.5% = 0.87W (dry weight) 0.87W × 50% = 0.435W (carbon) 59 0.435W × 3.6663 = 1.5948W (CO2 sequestered for 10 years) 1.5948W / 10 years = 0.15948W (CO2 sequestered per year) Therefore, the value of CO2 sequestered in one tree per year on average is equal to 0.15948W. 2.6 Revit API Development A tool can be developed that takes into account the use of materials (and their volumes) to discover the embodied carbon in a building. Then the number or mass of trees can be suggested for carbon sequestration. Revit is a building information modeling software program often used by architects. Revit API development is the use of Revit software's own API interface to achieve the development of each function of the component through the program code. Usually, ordinary modeling operations are performed using only the button functions in the menu bar. Revit API is a portal through which developers can access the various functions of Revit, and program developers can expand and optimize the Revit software according to user needs based on visualization and data analysis operations. The information structure units in the data model can also be accessed, added attributes, changed, and created new components to obtain relevant data, analyze data, etc. At present, the following functions can be achieved in the application software through Revit API development techniques (Yang et al., 2022): (1) Building plug-ins that can quickly and accurately extract and modify 60 component parameter information by writing code. (2) Editing functions such as moving floor slabs and adding walls through editing programs. (3) Data interconnection between different BIM software can be achieved through an external program interface. (4) Programming and adding the required arithmetic functions in the design process and using the arithmetic functions to analyze the data of the model. Dynamo can successfully do a similar process as the developed plugin does by counting how much carbon is contained in various materials in a building and the carbon emissions of the entire building operation, but it is much slower. Another better approach is to use a custom add-in written in the Revit API as an add-in in the Revit software that connects to the Revit model. This involves an additional step of writing the carbon content of building materials and the carbon emissions of building operations to a text file, which is then entered into the Revit add-in as a CSV format. In the future, smarter coding will connect the output directly to Revit and count the carbon accounting directly (Kensek, 2014). As one of the most promising developments, building information modeling (BIM) automates the design process. It brings the possibility to automate the design process. Previous research work has focused on permanent design components, while the assessment of the environmental impact of the whole life cycle of a building, such as 61 the calculation of the carbon content of building materials and the carbon emissions during the operational phase of the building, has been scarce. However, although today there are some software or plug-ins like Beacon that can calculate the relevant components, they are generally more cumbersome, slower, and less convenient (Is Beacon Technology in Your Company’ s Future? | Blog - BairesDev, 2022). A BIM- based pug-in can be designed to help assess and calculate the carbon emissions of a building, which combines information related to individual elements in the BIM model with the U.S. Building Carbon Design Code and the Chinese Building Carbon Design Code through an application programming interface (API) in Revit. Using this tool, planners will be able to determine the use of building materials and the planning of surrounding vegetation based on the carbon emissions and carbon content of the current building model (Ziyu Jin and John Gambatese, 2019). The new plug-in could be highly applicable and easy to use, making it easier for designers or developers to do low- carbon building design. 2.7 Summary This chapter described current research on embodied carbon and operational carbon, carbon accounting as a critical methodology in embodied carbon estimation, methodology for carbon neutrality, carbon trading, tree database with sequestration, and Revit API development. Although embodied and operational carbon are created throughout the lifecycle of the 62 building, current software generally focuses on the materials of construction, which plays a large role. This method, although not covering all phases, calculates the amount of material in a building to determine the number of carbon trade-offs. The planting of trees for offsets is one way to achieve carbon neutrality. A Revit tool could be developed through the Revit API for creating an interface to enable a plug-in to determine the carbon footprint and the approximate amount of landscaping to offset it. Chapter 3: Methodology This chapter discusses establishing the environment of Revit API development, basic programming methodology, and codes for different functions (Fig. 3-1). 63 Figure 3-1 Methodology Diagram This chapter covers the first two parts, which are establishing the programming environment for the Revit API development and describing the specific functions that each code block in External Command needs to achieve. The next two chapters are a case study of the simulation run using the building model after the plug-in has been developed (Chapter 4) and a side-by-side comparison, validation, and evaluation of the plug-in after it has been tested (Chapter 6). For the first two parts, Visual Studio will be used to configure the PC environment required for Revit API development. Based on the .NET framework, the C# 64 programming language is used for the Revit API development of Revit with the user program interface API provided by Autodesk for Revit. There are three ways to do the Revit API development: external commands (IExternalCommand), external applications (IExternalApplication), and macros (Macro). IExternalCommand is used in creating this tool. Using the abstraction functionExecute () in the IExternalCommand interface, the corresponding Revit command will be added, and when the user clicks the Start command button, the program will override this function to implement IExternalCommand. After completing the design of the UI interface, the first interface of the plug-in in Revit appears when the plug-in is launched, which provides the user with the embodied carbon information of the current building materials and automatically counts and calculates it (Fig. 3-2). Figure 3-2 First User Interface 65 Based on the total embodied carbon calculated in the previous interface and imported landscape carbon absorption or storage, the second screen will determine how much landscaping is needed or how much weight of landscaping is needed around the building to achieve carbon offset (Fig. 3-3). Figure 3-3 Second User Interface If the balance is not reached, then carbon payments will be made in the carbon trading market according to the existing international standards for carbon trading. Other features in the plug-in will allow users to isolate objects that are being used by the plug- in and check their material definition and add them to a tree database. Several code modules will be discussed that were created for this plugin (Fig. 3-4). 66 Figure 3-4 Code Modules 3.1 Establish the Environment of Revit API Development The configuration of the development environment is the first step to any RevitAPI development; the required Revit SDK, Revit API, and Revit version must be consistent. One must configure the AddinManager and Revit Lookup and add RevitAPI.dll and RevitUI.dll to complete the basic development language environment configuration. 3.1.1 Revit SDK 2023 Revit SDK contains Revit API help files and cases with source code, Revit SDK needs to be consistent with the Revit version being used. The add-in manager in Revit SDK 67 is the official add-in of Revit, used to load the Revit add-in; RevitAPI.chm is the help file of RevitAPI. Download Revit SDK 2023 here to adapt to Revit 2023 (Fig. 3-5). Figure 3-5 Revit 2023 SDK 3.1.2 Revit Lookup Because the design of the plug-in relies heavily on reading information from the model data, by installing Revit lookup, element data such as element ID, the Bounding Box (x, y, z coordinates), the level ID, and location can be exposed. All of these are available through the Revit API, but otherwise invisible to the end users (Fig. 3-6). 68 Figure 3-6 Revit Lookup 3.1.3 Configuring AddInManager AddinManager has Autodesk.AddInManager.addin, AddInManager.dll, and AddInManager.dll.config; the others are description files. 1. Autodesk.AddInManager.addin: the registration file of AddInManager, triggered when Revit starts; this is similar to a text file, which can be opened by Visual Studio. 2. AddInManager.dll: the library file of AddinManager, which is not modifiable. 3. AddInManager.dll.config: configuration information of AddinManager. 69 Copy the files from Autodesk.AddInManager.addin, AddInManager.dll, and AddInManager.dll.config from the Add-In Manager directory in RevitSDK to the "C:\ProgramData\ Autodesk\Revit\Addins\2023" directory (Fig. 3-7). Figure 3-7 Revit Add-Ins 2023 Files Change the path of <Assembly> .... <Assembly> in Autodesk.AddInManager.addin into the path where AddInManager.dll is located (Fig. 3-8). 70 Figure 3-8 Autodesk.AddInManager.addin Program 3.1.4 Create Project in Visual Studio with .NET Framework Create a new project in Visual Studio and select the class library (Fig. 3-9). NET 6.0 was chosen as the framework for this Revit API development (Fig. 3-10). Figure 3-9 Create New Project 71 Figure 3-10 .NET Framework 6.0 3.1.5 RevitAPI.dll and RevitAPIUI.dll In VS (Visual Studio), refer to RevitAPI.dll and RevitAPIUI.dll which are in the installation directory of Revit 2023, and add them to the references in Explorer of VS (Fig. 3-11). 72 Figure 3-11 References of Explorer in VS Add these two references to the project and write the codes for externcommandsand (Fig. 3-12). 73 Figure 3-12 ExternalCommand.cs 3.2 Basic Programming Modules After setting up the C# language development environment, the organization of the code should be decided. The overall programming is divided into three steps: the requirement analysis, UI interface design, and setting of the Revit interface (Fig. 3-13). xxx 74 Figure 3-13 Basic Modules of Programming Chapter 4 describes the process of using the plugin. This section describes the basic programming modules that are used to create the tool. (1) Requirement Analysis: according to the model data of Revit, the carbon spreadsheet and tree sequestration sheet can be calculated and summarized according to the customizable data settings. In this process, there are three steps: a. Get the model parameters b. Read the model material information, then the material of the model corresponds to the data category in the sheet, and finally the data units in the Revit model should be converted with the data units in the sheets. c. Calculation Summary For example, there is a simple building model with four walls (Fig. 3-14) and one of which has three different layers (Fig. 3-15). Then run the plug-in, and it can be seen the 75 red rectangle which shows up all the different layers are read by the plug-in (Fig. 3-16). Figure 3-14 Simple Building Model Figure 3-15 Different Layers of One Wall 76 Figure 3-16 Calculation Output with All the Read Layers (2) UI Interface Design: the UI interface for user interaction is divided into two parts, the first part is Embodied Carbon Calculation interface, and the second part is the Carbon Accounting interface. Each button or option on the interface is hyperlinked with the corresponding program, which is reflected in the programming codes that will show in the following part. (3) Revit Interface: The Revit API development needs to refer to two Revit program sets RevitAPI.Dll and RevitAPIUI.Dll, which contain many methods and external interfaces in the program set, through the reference to the two files, users can directly call the methods and access the interfaces directly in the programming process. Both RevitAPI.Dll and RevitAPIUI.Dll references 77 library can be seen above. 3.3 Codes for different functions This section discussed the codes for various functions containing Assembly Information of the Program, View Model of First User Interface, Reading the Materials Information, Headers of the First User Interface Screen, View Model of Carbon Unit Spread Sheet, Functions of the Carbon Spread Sheet in Plug-in, Choose the Declared Unit in Carbon Spread Sheet, Calculate the Read Material’s Value in Total, Isolate the Read Material, View Model of Tree Sheet, View Model of Adding Data in Tree Sheet, Functions of Tree Sheet in Plug-in, View Model of Second User Interface, View Model of Adding the Input Tree Data, View Model of Tress Mass Method, and Images Used in Plug-in. 3.3.1 Assembly Information of Program General information about the assembly is controlled by the following code modules (Fig. 3-17). Changing the values of these characteristics modifies the information associated with the assembly. 78 Figure 3-17 Assembly Info.cs 3.3.2 View Model of First User Interface The first user interface contains Tree Sheet, Carbon Unit Spreadsheet, Total value, Isolate button, Calculate button, Next button and Cancel button, which the main functions are showing the reading material and corresponding value, isolating the reading material and embodied carbon calculation (Fig. 3-18). 79 Figure 3-18 Embodied Carbon Calculation Interface 3.3.3 Reading the Materials Information The ReadMaterials function reads the material information in the model, such as ReadWallMaterials (Fig. 3-19), ReadFloorMaterials (Fig. 3-20), ReadRoofMaterials (Fig. 3-21), ReadFramingMaterials (Fig. 3-22), ReadColumnsMaterials (Fig. 3-23). It uses the element filters to filter the categories Wall, Floor, Roof, Framing, and Columns respectively. 80 Figure 3-19 Read Wall Material Figure 3-20 Read Floor Material 81 Figure 3-21 Read Roof Material Figure 3-22 Read Framing Material Figure 3-23 Read Columns Material 3.3.4 Headers of the First User Interface Screen Through coding, make the grid on the first user interface and add the corresponding headers for each line or each column that includes the materials’ information ready by plug-in (Fig. 3-24). The programming code, which corresponds to the material information, is read by the plug-in to the headers one by one (Fig. 3-25). 82 Figure 3-24 Headers of Line and Columns in First User Interface Figure 3-25 Codes of Headers 83 3.3.5 View Model of Carbon Unit Spread Sheet After clicking the Unit Sheet on the first interface, it is intended that users can add, edit, or delete slides or fixed data (Fig. 3-26). Slide data means the value of data including a range from a minimum value to a maximum value like 0-2500 psi Ready Mix Concrete. Fixed data means the value of data is fixed and solid, which doesn’t fluctuate. Figure 3-26 Carbon Unit Spreadsheet If the ‘add data’ is clicked, users can input the material’s Group, Unit type, Min Value, Max Value (Min and Max Value only exist in the slide data.), Category, Value Type, Value Unit. After the users enter the information, the plug-in will automatically calculate each information of the corresponding materials in the current model and the table according to the pre-defined embodied carbon emission standards, and finally 84 perform the calculation (Fig. 3-27). Figure 3-27 Category of the Input Material In general, to pre-define a material that the current Revit building model already has and the users want the plug-in to read it, the users need to select which group the material belongs to first to make it easier to find it later. Then they need to enter the name of the material in the category, such as Concrete, Precast, of which the most critical part is that it must be consistent with the name of this material in the building model, otherwise, the plug-in is not able to read the corresponding material. Afterward, users can choose any volume unit in the Value Unit, and the plug-in will convert the unit automatically. Finally, enter the amount of embodied carbon per unit volume of the material in the Value blank. 85 Subsequently, this plug-in will read this material according to the pre-defined information and shows up all the information or value under each of the headers including how much volume of this material the building has. Similar to this step, after adding all the materials, then clicking calculate button, the value of total embodied carbon of all the read material of the current Revit model will display (Fig. 3-28). Figure 3-28 Embodied Carbon Calculation in First UI 3.3.6 Functions of Carbon Spread Sheet in Plug-in Functions for adding, deleting, modifying, etc. need to be created with coding for the carbon spreadsheet in the plug-in (Fig. 3-29). 86 Figure 3-29 Carbon Spreadsheet Functions 3.3.7 Choose the Declared Unit in Carbon Spread Sheet In the carbon unit sheet, users will be able to customize it by adding slide data or fixed data, which means that there needs coding to let them add their own embodied carbon standards for building materials and sort them according to the options suggested in the sheet (Fig. 3-30). For example, Mix Concrete belongs to Concrete Group, and its value type and unit are CF (Fig. 3-31). 87 Figure 3-30 Codes of Declared Unit in Carbon Unit Sheet Figure 3-31 Declared Unit in Carbon Unit Sheet 88 3.3.8 Calculate the Read Material’s Value in Total After getting the information of materials of the building model like types, volumes, and volume unit, the plug-in then calculates the total embodied carbon combined with the pre-defined carbon unit sheet which includes how much embodied carbon per unit is contained in different types of materials (Fig. 3-32). The rightmost column contains the amount of embodied carbon of each material in the corresponding unit, and the total value is obtained by summing up all the data (Fig. 3-33). Figure 3-32 Codes of Embodied Carbon Calculation 89 Figure 3-33 Embodied Carbon Calculation in the First User Interface 3.3.9 Isolate the Read Material To make it easier for users to see what materials the plugin can read from a building model and what materials it cannot read an isolation function is added through the coding (Fig. 3-34). By clicking the Isolation button in the lower left corner (Fig. 3-35), the model in the current view will automatically isolate the materials read by the plugin and hide the materials not read. 90 Figure 3-34 Isolation Function Figure 3-35 Isolation Button 3.3.10 View Model of Tree Sheet After clicking the tree sheet button on the first interface in the top right corner, a climate 91 zone map will be shown up including 8 climate zones. Users can check the geographical location of the current building to derive which climate zone it belongs to, to facilitate the selection of trees to be planted in the corresponding climate zone to complete the carbon neutrality. In this tree sheet, users can add, edit or delete any tree data with flexibility (Fig. 3-36). All the added trees will show and are available for users to see which trees they have added or they want to edit or delete (Fig. 3-37). Figure 3-36 Codes of Tree Sheet 92 Figure 3-37 Tree Sheet Interface 3.3.11 View Model of Adding Data in Tree Sheet The user can add to the ADD DATA any type of tree he wants, its name, geographical location, the amount of carbon absorbed by the tree per year, and the corresponding units. (Fig 3-38). Figure 3-38 Adding Data in Tree Sheet 93 3.3.12 Functions of Tree Sheet in Plug-in It will be possible to customize the addition of any species of tree by directly entering the name of the tree and entering the climate zone to which the tree belongs and the amount of CO2 sequestered per year (Fig. 3-39). This data will be saved permanently and displayed in the tree sequestration sheet and can be edited or deleted at any time (Fig. 3-40). Figure 3-39 Adding Data in the Tree Sheet Interface 94 Figure 3-40 Tree Sheet Codes 3.3.13 View Model of Second User Interface The second user interface will contain a climate zone map, and add edit and delete data buttons. It can show the total embodied carbon that is calculated in the first user interface (Fig. 3-41). After users offset the embodied carbon by selecting the certain tree they input in the tree sheet in advance or selecting the certain mass of the tree, the value of the rest of embodied carbon will show. Then, users can input the carbon credit price and check how much they still need to pay after carbon neutrality. The main function is to do carbon neutrality and carbon trading according to the total embodied carbon calculated in the previous interface (Fig. 3-42). 95 Figure 3-41 Carbon Accounting Interface Figure 3-42 Codes of Carbon Accounting Interface 3.3.14 View Model of Adding the Input Tree Data After customizing the tree sequestration sheet, users will be able to add the input tree 96 data in the carbon accounting interface to decide which types of trees they would like to plant and how many trees they want to plant (Fig. 3-43). Figure 3-43 Adding the Input Data 3.3.15 View Model of Tress Mass Method As the second method of carbon neutrality, the interface includes a drop-down menu with two methods, Tree Count and Tree Mass (Fig. 3-44). In the Tree Mass interface, there is a default Unit Tree Mass, which can also be changed by users according to the requirements, and then Need Tree Mass on the right will show how much weight of the tree is needed based on the current amount of embodied carbon. The default values and equation for calculation are shown, which have been described in detail in the previous 97 chapter (Fig. 3-45). Figure 3-44 Two Methods for Carbon Neutrality in Second UI Figure 3-45 Codes of Methods for Carbon Neutrality 98 3.3.16 Images Used in Plug-in Some images need to be added manually in the programming software: the logo of the plugin (Fig. 3-46) and the corresponding codes (Fig. 3-47), the climate zone map (Fig. 3-48) the corresponding codes (Fig. 3-49), and the “tip” in Tree Mass Method (Fig. 3- 50) the corresponding codes (Fig. 3-51). Figure 3-46 Logo of ‘CAT’ 99 Figure 3-47 Codes of Logo of ‘CAT’ Figure 3-48 Climate Zone Map Figure 3-49 Codes of Climate Zone Map 100 Figure 3-50 Tips of Default Value of Tree Mass Method Figure 3-51 Codes of Tips of Default Value of Tree Mass Method 3.4 Summary This chapter described establishing the environment of Revit API development, basic 101 programming modules, and codes for different functions. The Revit SDK 2023, Revit Lookup, and AddInManager were configured to build a C# programming language environment and the Revit API was developed using the .NET 6.0 Framework. After the interaction between VS and Revit, the plug-in was divided into two user interfaces in general. In the first user interface, the codes were written to read the Revit model material information and performed the current building material embodied carbon calculation based on the custom criteria. In the second user interface, carbon offsets were performed by planting trees with user-defined criteria for carbon dioxide sequestration of different tree species or mass. Finally, users can enter the current carbon credit price in the carbon market to check how much the building owner has to pay for the remaining carbon emissions of the current building after carbon offsetting. To show more visually and clearly what types of Revit materials can be read by the CAT plug-in, a component list was made below. The first column is the name of components of types, the second column is whether plug-ins can read or not, and the third column is the examples of this certain type of component. All the material types that can be read by CAT plug-in were highlighted in yellow (Table. 3-1). 102 Table 3-1 Component List The functions of codes for the major parts contain Assembly Information of Program, View Model of First User Interface, Reading the Materials Information, Various Titles of First User Interface, View Model of Carbon Unit Spread Sheet, Functions of Carbon Spread Sheet in Plug-in, Choose the Declared Unit in Carbon Spread Sheet, Calculate the Read Material’s Value in Total, Isolate the Read Material, View Model of Tree Sheet, Functions of Tree Sheet in Plug-in, View Model of Second User Interface, View Model 103 of Adding the Input Tree Data, View Model of Tress Mass Method, View Model of Tress Mass Method, and Images Used in Plug-in. The full code is in Appendix B. 104 Chapter 4: Case Study – Using the CAT Plug-in This section discusses the starting guide of the carbon accounting tool (CAT) and carbon accounting results for a sample house. Before starting to use the CAT plug-in, there are several prerequisites that the user's computer must meet, otherwise, it will not be able to run the plugin and get the results the user wants. The Revit platform was chosen as the base of the CAT plugin because of its developer tools and popularity in the building profession. The Revit version used cannot exceed 2023 because each version has its specific API. The API of the new version will be compatible with the old version, but the API of future versions higher than Revit 2023 will have new features, which will lead to incompatibility with Revit API 2023, and thus the plug-in will not run. Last, Visual Studio (VS) is also required because it brings along all that this programming project needs and uses C# attributes to declare a function in the code directly. 4.1 Starting Guide of Carbon Accounting Tool (CAT) This guide introduces the steps of downloading the VS file and Revit file, opening a sample building file in Revit, external tools in Revit Add-Ins, entering the first UI, isolation of the read materials, carbon unit sheet, solution of ‘Unknown’ and layers of materials problem, entering the first UI, both pre-defined carbon unit sheet and tree sheet and the carbon trading if needs. 105 4.1.1 Download the VS File and Revit File The Carbon Accounting Tool is available both as a zip file and a rar file. Download these files, unpack, and put them into these folders (Fig. 4-1). Figure 4-1 CAT Plug-in VS File One sample Revit file is included. (Fig. 4-2). Figure 4-2 Sample Building 4.1.2 Open Sample Building File in Revit. Open the Sample Building. rvt in Revit (Fig. 4-3) and a simple building including mass, trees, walls, columns, floors, framing, and roof will display (Fig. 4-4). 106 Figure 4-3 Open Sample Building. rvt Figure 4-4 A Simple Building Model 107 4.1.3 External Tools in Revit Add-Ins Add-In Manager is an official add-in provided by Autodesk. It is a tool used to quickly load or unload the Revit API development program; without manually creating an Addin file, it can automatically save the load command. The difference between Manual Mode, Manual Mode, Faceless, and ReadOnly Mode is that Manual Mode corresponds to Manual transaction mode, Read Only Mode corresponds to Read Only transaction mode, Manual Mode, Faceless means to run the add-in that was just run once before. After opening the Revit file, click Add-Ins. Then Click Add-In Manager (Manual Mode) in the dropdown of External Tools (Fig. 4-5). Figure 4-5 Add-In Manager (Manual Mode) Then click ’Load’ (Fig. 4-6). 108 Figure 4-6 Add-In Manager Interface Then open ‘bin’ (Fig.4-7) in the Carbon Emissio file just downloaded and open ’debug’ (Fig.4-8), click ‘CarbonEmissio.dll’ (Fig.4-9), and load into Add-In Manager (Fig.4- 10). 109 Figure 4-7 ‘bin’ File Figure 4-8 ‘debug’ File 110 Figure 4-9 CarbonEmissio.dll 111 Figure 4-10 CarbonEmissio.dll in Add-In Manager Then select the Carbon Emissio. ExternalCommand under CarbonEmssio.dll and click ‘Run’ (Fig. 4-11). 112 Figure 4-11 Carbon Emissio.ExternalCommand 4.1.4 Enter the First User Interface After running the CarbonEmissio. ExternalCommand, the first user interface screen will show up. The logo of the CAT plug-in is in the top left corner, and the top right corner, there are two buttons, which are Tree Sheet and Unit Sheet. Moreover, the Isolation button is in the bottom left corner, and Calculate, Next and Cancel are in the bottom right corner (Fig. 4-12). 113 Figure 4-12 First User Interface There are eight columns of data on the material: Family, Material: Description, Material: Result, Unit CO2e, Type, V olume, V olume Unit, and CO2e. • Family is the family type name of the material being read for carbon content; • Materials: Description is the identity name in the material browser; • Material: Result is the material name read in conjunction with the material name already defined in the Carbon Unit Sheet. If the material name cannot be found in the Carbon Unit Sheet, then Unknown will be displayed automatically; • Unit CO2e is the amount of embodied carbon contained per unit volume of the material; 114 • Type is the type name of each certain material which can be changed or duplicated so as not to be confused; • V olume is the volume of each certain material, due to the imperial unit, the default volume unit of material is CF; • V olume Unit is the current Revit default volume unit, which is m 3 for metric units and CF for imperial units. • CO2e means CO2 equivalent, for any amount and type of greenhouse gas, CO2e represents the amount of CO2 which would have the equivalent global warming impact. Here the CO2e is the value of embodied carbon of the material. After clicking the Calculate button, the value of the total embodied carbon of the current material can be shown up in the Total blank (Fig. 4-13). 115 Figure 4-13 Total Embodied Carbon of the Read Material 4.1.5 Isolation of the Read Materials To facilitate the user’s ability to see which materials of the building can be read by the plugin and which cannot, an isolation button is available. After clicking the isolation button, the building model in the current view automatically isolates the building materials that have been read (that will be used in the carbon calculation) and hides the building materials that have not been read (will not be used in the carbon calculation) (Fig. 4-14). There is an example of the 3D view before isolation (Fig. 4-15) and after isolation (Fig. 4-16). 116 Figure 4-14 Isolation Function Figure 4-15 Before Isolation 117 Figure 4-16 After Isolation 4.1.6 Carbon Unit Sheet In the Carbon Unit sheet interface, there are five buttons: Add Slide Data, Add Fixed Data, Edit Data, Delete Data, and Close (Fig. 4-17). 118 Figure 4-17 Carbon Unit Sheet Both Add Slide Data and Add Fixed Data can be clicked by users to add any data or materials that the current building model owns with flexibility. In the Add Fixed Data, there are Groups, Categories, Value Types, Value Units, and Values for users to input (Fig. 4-18). 119 Figure 4-18 Add Fixed Data In the Group, users can decide which group this material belongs to, like Concrete. The category is the name of the current pre-defined material. The value Type should be volume because the default unit of materials in the first user interface is volume. There is a dropdown in the Value Unit including various volume units like cm 3 , CF, m 3 , etc. (Fig. 4-19). Value is how much embodied carbon this pre-defined material has per unit. Figure 4-19 Various Value Unit For example, the building has a Concrete, Precast Wall currently. If users need a CAT plug-in to read this wall material, they should pre-define this material in the Carbon 120 Unit Sheet. Therefore, • Group should input ‘Wall’ • Category should be input ‘Concrete, Precast’ • Value Type should be selected ‘Volume’ • Value Unit should be selected ‘CF’ • Value should be input ‘545’(ownersCAN ECAP Specification Matrix, 2022) This means Concrete, Precast material belongs to Wall and contains 545kg embodied carbon per CF (Fig. 4-20). Figure 4-20 Pre-defined Concrete, Precast Material Sample Compared to Fixed Data, Slide Data includes a range between the maximum value and minimum value, and the rest of the subtitles are the same as slide data (Fig. 4-21). 121 Figure 4-21 Add Slide Data For example, the building is using 0-2500 psi Concrete currently. If users need a CAT plug-in to read this material, they should pre-define this material in the Carbon Unit Sheet. Therefore, • Group should input ‘READY MIX CONCRETE’ • Unit Type should be input ‘lb/in 2 ’ • Min Value should be input ‘0’ • Max Value should be input ‘2500’ • Category should be input ‘0-2500 lb/in 2 ’ • Value Type should be selected ‘Volume’ • Value Unit should be selected ‘m 3 ’ • Value should be input ‘340’(ownersCAN ECAP Specification Matrix, 2022) This means 0-2500 psi material belongs to READY MIX CONCRETE and contains 340kg embodied carbon per m 3 (Fig. 4-22). 122 Figure 4-22 0-2500psi Concrete Slide Data Therefore, re-open the Carbon Unit Sheet and the newly added material data will show up (Fig. 4-23). Figure 4-23 0-2500psi Concrete Slide Data 4.1.7 Process of ‘Unknown’ and Layers of Materials As mentioned above, what material the plugin can read and what name it displays are based entirely on the pre-defined Carbon Unit Sheet, which means that if there is a 123 building material that isn’t added to the Carbon Unit Sheet, the CAT plug-in will show ‘unknown’ for that material accompanied by the value of CO2e is 0. For example, if there is a wall with Iron, Ductile material that isn’t added to the Carbon Unit Sheet in advance it isn’t “known” in the plugin. (Fig. 4-24). Figure 4-24 Undefined Material Iron, Ductile After running the plug-in, Material: Result will show ’Unknown’ and CO2e is 0 even after calculation because the CAT plug-in doesn’t read this material (Fig. 4-25). 124 Figure 4-25 ‘Unknown’ Situation To solve this problem, users should pre-define the Iron, and Ductile in the Carbon Unit Sheet and input certain data. After running the plug-in again, the Material:Result and value will show up like the others (Fig. 4-26). 125 Figure 4-26 The Material Name that has been read and CO2e that has been calculated Most materials have various layers with different thicknesses, like most walls. CAT plug-in can also read all the layers and display them respectively with their volume. For example, there is a basic wall of the current building having three layers: Brick, Common, Cherry, and Concrete, Precast with a thickness of 2’’, 8’’, and 1’ respectively whose type is called ‘XS wall with Cherry’ (Fig. 4-27). 126 Figure 4-27 Basic Wall with Three Different Layers Then run the CAT plug-in and find ‘XS wall with Cherry’ (Fig. 4-28): Figure 4-28 Basic Wall with Three Different Layers It can be found that there are three rows whose Types are ‘XS wall with Cherry’ with three different Materials:Result, which represents three different layers’ with different 127 volumes mentioned above in Fig.4-27. 4.1.8 Tree Sheet After clicking the Tree Sheet button on the first user interface, there are four buttons: Add Data, Edit Data Delete Data, and Close. On the left of the screen, there is a climate zone map for users to decide which climate zone to choose trees to plant in according to the location of the building (Fig. 4-28). Figure 4-28 Tree Sheet Similar to the carbon unit sheet, as for adding the tree data, users can also add any tree data they plan to use for landscaping. In the Add Data, there are Climate Zone, Tree Types, CO2e PerDay, CO2e PerYear, and Unit for users to input (Fig. 4-29). 128 Figure 4-29 Add Tree Data As forIECC Climate Zone, there is a dropdown containing climate zone 1 to 8 for users to choose according to the location of the building so that the trees are in the most suitable growing climate to achieve maximum carbon sequestration. (Fig. 4-30). Figure 4-30 Climate Zones 1-8 Tree types are the names of the pre-defined trees that users plan to plant. CO2e PerDay and CO2e PerYear are user inputs that pre-define how much CO2 each tree can sequester 129 per day or year. There is a dropdown in the Unit including the various unit of CO2 sequestered by trees (Fig. 4-31). Figure 4-31 Various Units For example, the building is currently located in Climate Zone 3, so • Climate Zone should be selected ‘Climate Zone 3’ • Tree Types should be input ‘Case Study Tree’(Test Sample) • CO2e PerDay should be input ‘2.7’ (Test Sample) • CO2e PerYear should be input ‘1000’ (Test Sample) • Unit should be selected ‘kg’ Which means ‘Case Study Tree’ from Climate Zone 3 can sequester 1000kg CO2e per year (Fig. 4-32). 130 Figure 4-32 Case Study Tree Data 4.1.9 Enter the Second User Interface After clicking the Next button on the first user interface, the second user interface screen will show up. On the left side of the screen, there is a climate zone map mentioned above. In the top right, there are two blanks: Building CO2e and Year Target. Building CO2e is the automatically calculated value of the total embodied carbon of the building model in the previous interface. Users can input a flexible number of years in the Year Target, which means how many years they plan to use for this building to accomplish the goal of carbon neutrality (Fig. 4-33). 131 Figure 4-33 Second User Interface with IECC Climate Zones Map 4.1.10 Tree Count Method for Carbon Neutrality There are two methods for carbon neutrality. The first one is Tree Count; there are three buttons for the Tree Count method: Add Tree, Edit Tree, and Delete Tree (Fig. 4-34). Figure 4-34 Tree Count Method 132 After clicking Add Tree button, there are Tree Types, Unit CO2e, Tree Count, and Surplus CO2 for users to input (Fig. 4-35). Figure 4-35 Add Tree Data Tree types contain the tree names and which climate zone they belong to. All of the data is what users pre-define in the Tree Sheet of the previous interface. There is a dropdown for users to select (Fig. 4-36). 133 Figure 4-36 Tree Types After selecting a pre-defined tree, Unit CO2e is the value of how much this chosen tree can sequestrate per year, which will show up automatically. Tree Count will display a value automatically for how many trees of that type are needed if only planting this type of tree in total based on the total amount of CO2e in the building (Fig. 4-37). 134 Figure 4-37 The Number of Trees Required in The Case of Planting Only One Type of Tree. If users want to plant multiple types of trees, they can modify the Tree Count value by themselves as they need. After inputting the target number of trees, the surplus CO2 will display the value of the rest of embodied carbon after the currently selected tree sequestration. If the value is positive, it will appear green, and the negative will appear red. If this value turns green, it means that the current number of this tree is enough for the whole building’s carbon neutrality (Fig. 4-38). If red, it means that the current number of this tree hasn’t been enough for the whole building’s carbon neutrality yet (Fig. 4-39). 135 Figure 4-38 Green Surplus CO2 Figure 4-39 Red Surplus CO2 4.1.11 Tree Mass Method for Carbon Neutrality The second method for carbon neutrality is Tree Mass. There are two blanks below the Tree Mass option. The first one is Unit Tree Mass which is the unit mass of carbon dioxide that can be sequestered per unit mass of tree per year. It has a default value at the beginning which is taken from a literature dedicated to the calculation of annual carbon sequestration in trees based on tree mass (How to Calculate the Amount of CO2 Sequestered in a Tree per Year, 2022.). However, users can still modify this value as per their requirements. Need Tree Mass will display the value of the required mass of the tree after deciding the value of Unit Tree Mass automatically. Additionally, there are tips below including the equations and 136 literature source of the default value (Fig. 4-40). Figure 4-40 Tree Mass Method 4.1.12 Carbon Trading After either method is selected, the total sequestered carbon after target years will show up in the Total blank. Then as for the carbon trading part, Surplus (kg) is the value of the rest of the embodied carbon of building materials after tree sequestration. Similarly, If the value is positive, it will appear green, which means that no more trees are needed. Negative will appear red which means that it still needs more trees to plant to reach the goal of carbon neutrality (Fig. 4-41). As for the Unit Price, it is flexible for users to input the current price of carbon market credit which can refer to some carbon markets on the website (Carbon Credit Pricing Chart: Updated September 2023, n.d.). The Price is how much carbon trading costs. 137 After inputting the Unit Price, the Price will be calculated and displayed automatically (Fig. 4-41). Figure 4-41 Carbon Trading 4.2 Carbon Accounting Results for a Sample House 4.2.1 Sample House Select a sample house model to do the case study of the CAT plug-in (Fig. 4-42). Repeat the operations from 4.1.1 to 4.1.3. 138 Figure 4-42 A Sample House for Case Study 4.2.2 List and Images of All the Revit Components Used in The Calculation Family Type Material Image Basic Roof XS ROOF 1 Basic Wall XS wall 2 139 Basic Wall XS wall 1 Basic Wall XS wall with Cherry W Shapes- Column W 10×49 140 W Shapes- Column W 10×49 W Shapes (Framin g System) W12 × 2 6 Table 4-1 List and Images of All the Revit Components Used in The Calculation 4.2.3 Isolation of the Read Materials After clicking the isolation button (Fig. 4-43): 141 Figure 4-43 Isolation for the Case Study 4.2.4 Pre-defined Materials with Embodied Carbon Content Before reading the materials and calculating, users should pre-define all the materials that the current building models are made from otherwise the Material:Result will display unknown, which means the value of embodied carbon of this material cannot be counted (Fig. 4-44). 142 Figure 4-44 Pre-defined Carbon Unit Sheet 4.2.5 Total Embodied Carbon Calculation After clicking the Calculate button, the value of total embodied carbon will display, 143 which is 273,238,451.71 kg (Fig 4-45). Figure 4-45 Total Embodied Carbon Calculation 4.2.6 Pre-defined Trees in Tree Sheet Before entering the second UI and doing the carbon accounting, users should pre-define all the trees that users plan to plant according to the location of the current building model. Then define several trees in different climate zones to do the tree sequestration in the case study (Fig. 4-46). 144 Figure 4-46 Pre-defined Tree Sheet 4.2.7 Tree Count Method in the Second User Interface In the second user interface, Building CO2e equals 273,238,451.71kg. Set the Year Target as 50 and choose the Tree Count Method first. Because the building is located in California State which belongs to Climate Zone 3, select Case Study Tree in Climate Zone 3 as the only type of tree, then calculate. The value of total tree sequestration is 270,000,000 kg. Therefore, the Surplus CO2 equals to 3,238,451.70kg which means it still needs more trees or carbon trading. Currently, the price of carbon credit on the carbon market is 0.15$/kg (Carbon Credit Pricing Chart: Updated September 2023, n.d.). Eventually, the final price for carbon trading for this building equals 485,767.75$ (Fig. 4-47). 145 Figure 4-47 Carbon Accounting with Tree Count Method 4.2.8 Tree Mass Method in the Second User Interface In the second user interface, Building CO2e equals 273,238,451.71kg. Set the Year Target as 50 and choose the Tree Mass Method. Use the default value of Unit Tree Mass (Every 1kg of tree sequestrates 0.15948kg CO2 per year) and the mass of tree of this building needs for carbon neutrality equals 34,266,172 kg (Fig. 4-48). In this way, the Surplus is negative and appears green which means that it has enough tree sequestration and doesn’t need to plant more trees or do the carbon trading (Fig. 4- 48). 146 Figure 4-48 Carbon Accounting with Tree Mass Method 4.3 Summary This chapter contains a starting guide to Carbon Accounting Tool (CAT) and carbon accounting results for a sample house. In the starting guide part, the guide begins with downloading the VS file and Revit file, opening the sample building file in Revit, and external tools in Revit Add-Ins. Then enter the first UI and introduce the function of isolation. Afterward, it discusses how to deal with the ‘Unknown’ and layers of materials problem. Furthermore, both the carbon unit sheet and tree sheet are pre-defined. Subsequently, enter the second UI and use the tree count method or tree mass method respectively for carbon neutrality and at last do the carbon trading if needed. In the carbon accounting results part, a sample house was shown and accompanied by 147 a list and images of all the Revit components that will be in the calculation, isolation of the read materials, pre-defined materials with embodied carbon content, total embodied carbon calculation, pre-defined trees in tree sheet, and tree count and tree mass methods in the second UI. Chapter 5: Discussion This chapter discusses the embodied carbon calculator for construction (EC3), discusses a sample building- concrete and a sample building-wood, and provides an overall comparison and analysis of the two software programs. The Embodied Carbon Calculator for Construction (EC3) is a tool designed to assess the carbon footprint and environmental impact of construction projects and to provide recommendations on how to reduce these impacts. EC3 can read different building materials, including doors, windows, and planting, and provide recommendations for alternatives. The CAT plug-in is similar in its ability to assess the carbon footprint of building materials, but not for the entire building project. EC3 has multiple data import methods, including Excel tables and API interfaces. However, its free version has more limited functions compared to the CAT plug-in. Two sample building models with concrete and wood materials were used to calculate the carbon footprint using both the CAT plug-in and EC3. In both cases, users had to 148 pre-define the specific materials used with their corresponding embodied carbon content per unit in the carbon unit sheet of the plug-in. After running the software, the total embodied carbon of the building was calculated by each tool. EC3 and CAT plug-in support a wide range of units and automatically convert the units used in Environmental Product Declarations (EPDs) to the units entered by the users. The chapter concludes by comparing the software and outlining their advantages and disadvantages. 5.1 Embodied Carbon Calculator for Construction (EC3) EC3 is a tool aimed at the construction and building design sector. Its main purpose is to assess the environmental impact and carbon footprint of construction projects and to provide recommendations on how to reduce these impacts. Compared to other embodied carbon software, EC3 has a user-friendly interface and multiple data import methods. Also, it covers a wide range of building materials, provides recommendations and alternatives, and generates carbon footprint documentation. Furthermore, EC3 is a software application that is designed to work with building information modeling (BIM) software, including Autodesk Revit. To use EC3 with Revit, users first need to export their Revit models to a format that EC3 can read, such as IFC or gbXML. The model can be analyzed after being imported into EC3. 149 5.1.1 EC3 and CAT plug-in EC3 and the CAT plug-in are similar in their ability to read the main building frame materials, their user-friendly interface, and their ease of use. The advantages of EC3 include the ability to assess the carbon footprint and environmental impact of building materials and provide recommendations and alternatives; the availability of multiple data import methods, including Excel tables and API interfaces; the ability to read more types of building materials, such as doors, windows, and planting and the ability to generate carbon footprint documentation. Moreover, EC3 is able to select the corresponding materials and information from EPDs in terms of materials, which is equivalent to EPDs nested inside EC3. So EC3 and EPDs can be used together to have a more comprehensive and perhaps more accurate understanding of the environmental impact of building materials as EPDs are much more specific about each building material. By using EC3 to quantify the embodied carbon, EPDs are used to assess other environmental impacts. However, the CAT-plugin can only allow users to pre-define the material names and information in advance in the unit sheet, which may be more flexible, but it is not convenient and most users do not have a complete library of material information like EPDs. The disadvantages of EC3 are that it is only suitable for assessing the carbon footprint and environmental impact of building materials, but not the whole building project; it can only cover data and guidelines for European regions; it does not have carbon neutrality and carbon trading functions for tree planting like CAT plug-in; and the free 150 version has more limited functions. In addition, EC3 is a tool that can complement BIM 360 by providing enhanced collaboration control for external collaborators, while CAT cannot run on the BIM 360 platform but only on Revit. Both are suitable for assessing the carbon footprint and environmental impact of building materials. On popularity: EC3 is already used by the construction and architectural design industry in Europe. It would be difficult to market the CAT plug-in, and one will probably not do that. 5.2 Sample Building - Concrete and Brick A sample building model with concrete materials in Revit was used to calculate the carbon footprint using the CAT plug-in and EC3 (Fig. 5-1). Figure 5-1 Sample Building Model with Concrete and Brick Materials The multi-Category material takeoff can be seen in the Revit spreadsheet (Fig. 5-2). 151 Figure 5-2 Multi-Category Material Takeoff 5.2.1 CAT Plug-in In the CAT plug-in, the user must pre-define the specific materials used with their corresponding embodied carbon content per unit in the carbon unit sheet of the plug-in according to the multi-category material takeoff (Fig. 5-3). 152 Figure 5-3 Pre-defined Carbon Unit Sheet After running the CAT plug-in, it can be seen that the total result of the current building is about 51,451,802 kgCO2e (Fig. 5-4). 153 Figure 5-4 Total Embodied Carbon in CAT plug-in 5.2.2 EC3 To create the project, firstly, log in to Autodesk Construction Cloud with an Autodesk account and find the certain model to import (Fig. 5-5). Figure 5-5 Import from Autodesk Then, under the drop-down of Plan & Compare Buildings, the file Sample Building Concrete.rvt is imported (Fig. 5-6). 154 Figure 5-6 Import the Building Model in EC3 Before the final results are determined, some of the materials of the model cannot be automatically read by EC3, which will show a blank instead. In these cases, the materials needed to be added manually in the EPDs of EC3 (Fig. 5-7). 155 Figure 5-7 EPDs of EC3 After defining all the materials so that EC3 can read them, the results can be obtained (Fig. 5-8). Figure 5-8 The Read Material in EC3 After setting up a range of materials and units, the result is automatically calculated by 156 EC3, which is 45,300,000 kgCO2e for this sample case (Fig. 5-9). Figure 5-9 Total Embodied Carbon in EC3 5.3 Sample Building -Wood A sample building model with wood materials in Revit is used to calculate both using CAT plug-in and EC3 (Fig. 5-10). Figure 5-10 Sample Building Model with Wood Materials The multi-Category material takeoff can be shown in Revit (Fig. 5-11). 157 Figure 5-11 Multi-Category Material Takeoff 5.3.1 CAT Plug-in In the CAT plug-in, the user must pre-define the specific materials used with their corresponding embodied carbon content per unit in the carbon unit sheet of the plug-in according to the multi-category material takeoff (Fig. 5-12). 158 Figure 5-12 Pre-defined Carbon Unit Sheet After running the CAT plug-in, it can be seen that the total result of the current building is 145,439kgCO2e (Fig. 5-13). 159 Figure 5-13 Total Embodied Carbon in CAT plug-in 5.3.2 EC3 To create the project in EC3, under the drop-down of Plan & Compare Buildings, the file Sample Building Wood.rvt is imported (Fig. 5-14). 160 Figure 5-14 Import the Building Model in EC3 Before the final results are calculated, some of the materials for the buildings are not automatically paired with the materials in the EC3 library, so the paired materials needed to be added manually in the EPDs of EC3 (Fig. 5-15). Figure 5-15 The Read Material in EC3 After setting up a range of materials and units, the result is automatically calculated by EC3, which is 139,000 kgCO2e (Fig. 5-16). 161 Figure 5-16 Total Embodied Carbon in EC3 5.4 Overall Comparison and Analysis of Two Tools EC3 and CAT were compared based on the total carbon footprint of the sample concrete and wood buildings, their interfaces, the ability to read Revit components and layers of materials, the volume of each read material, and the output. 5.4.1 Comparison of Sample Concrete and Wood Building Results Both EC3 and CAT plug-in supports a wide range of units (e.g., cm 3 , in 3 , m 2 , ft 2 , cf., or even acre). EC3 and CAT plug-in will automatically convert the units used in EPDs to the units entered by the users, which means that a building project to be processed can use any mix of SI, Imperial, or other common units that are convenient for the users. As for the sample concrete building, the total value of embodied carbon of the building obtained by CAT plug-in is 51,451,802kgCO2e and the total value of embodied carbon building obtained by EC3 is 45,300,000 kgCO2e. The percentage difference is roughly 12.7%. As for the sample wood building, the total value of embodied carbon of the building 162 obtained by CAT plug-in is 145,439kgCO2e and the total value of embodied carbon building obtained by EC3 is 139,000 kgCO2e. The percentage difference is roughly 4.5%. The analysis of the data shows that the two software programs produce different results separately, but they are very close. The reason for the difference may lie in reading accuracy, carbon content assigned to each material, and use of predefined EPDs: 1. Reading accuracy: the accuracy of the two tools to read the volume or weight of a material in construction. For example, for shapes-framing, the CAT plug-in reads 6.43CF, while EC3 reads 1352kg, which includes a conversion of the density of stainless steel. 2. Carbon content assigned to each material: The material information in the Carbon Unit Sheet of the CAT plug-in differs from the material information provided by the EPDs, which leads to a difference in the final calculation results (Table. 5-1). Material Name EC3 (EPDs) CAT Plug-in Concrete, Precast 220.9 kgCO2e/CF 445kg CO2e/CF Stainless Steel 1.25 kgCO2e/yd 3 =0.0462 kgCO2e/CF 0.00665 kgCO2e/CF Brick, Common 191 kgCO2e/yd 3 =7.074 4.2 kgCO2e/CF 163 kgCO2e/CF Plywood Sheathing 156 kgCO2e/yd 3 =5.78 kgCO2e/CF 5.5 kgCO2e/CF Softwood, Lumber 215.6 kgCO2e/yd 3 =7.98 kgCO2e/CF 8.5 kgCO2e/CF Cherry 585 kgCO2e/yd 3 =21.67 kgCO2e/CF 11.5 kgCO2e/CF Table 5-1 Comparison Table of the Sample Values of the Material Libraries of the Two Tools 3. Use of predefined EPDs: In EC3, the embodied carbon per unit volume, per unit importance, or unit area of each material is completely determined according to the predefined EPDs. In the CAT plug-in, the pre-defined Carbon Unit Sheet is completely user-defined and can be changed, added, or deleted by the user. The current default material and the corresponding embodied carbon content are searched on the World Wide Web and partly based on the EPDs of EC3. Because of the differences in the data in the material tables defined in advance behind the calculations of both, this leads to differences in the embodied carbon content corresponding to the materials read out, and thus to errors in the overall results. 164 5.4.2 Comparison of Interface Because the CAT plug-in can only be run in Revit, it only has two interfaces with a couple of buttons and a drop-down to simplify the operation and produce the result directly. The first UI shows the read material’s information and total embodied carbon of the certain building with two sheets button and isolation interaction function (Fig. 5- 17). Figure 5-17 First UI of CAT Plug-in The second UI contains a map of the planting zone, two methods of carbon neutrality, target year setting, and carbon trading function (Fig. 5-18). 165 Figure 5-18 Second UI of CAT Plug-in However, EC3, as a single software that can run on the website independently, has many user interfaces with multiple functions. For example, under the drop-down menu of Plan & Compare Buildings, users can import certain building models from Autodesk. Furthermore, templates can be created if there is no ready-made model but users need some building models to simulate (Fig. 5-19). Figure 5-19 Plan & Compare Buildings UI in EC3 166 Additionally, because EC3 uses EPDs as its material library, in EC3 for materials already read by EC3 or not read, users can define their own desired materials or add materials to the EPDs material library (Fig. 5-20). Figure 5-20 Define Materials with EPDs 5.4.3 Comparison of Ability to Read Revit Components As for sample concrete and brick building, schedules that contain all the materials can be obtained in Revit (Fig. 5-21). 167 Figure 5-21 Schedules of Sample Concrete and Brick Building Then after running the CAT plug-in, all the materials that the CAT plug-in can read the display on the first UI (Fig. 5-22). 168 Figure 5-22 Sample Concrete and Brick Building Materials Read by CAT Plug-in (A) 169 Figure 5-22 Sample Concrete and Brick Building Materials Read by CAT Plug-in (B) Then after running EC3, all the materials that EC3 can read are displayed on the building information UI (Fig. 5-23). 170 Figure 5-23 Sample Concrete and Brick Building Materials Read by EC3 (A) Figure 5-23 Sample Concrete and Brick Building Materials Read by EC3 (B) Therefore, it can be seen that EC3 can read more types of materials like Windows, Doors, and Planting which the CAT plug-in can’t read (Fig. 5-24). 171 Figure 5-24 The Materials That Cannot Read by CAT Plug-in but EC3 As for sample wood building, schedules that contain all the materials can be obtained in Revit (Fig. 5-25). 172 Figure 5-25 Schedules of Sample Wood Building Then after running the CAT plug-in, all the materials that the CAT plug-in can read the 173 display on the first UI (Fig. 5-26). Figure 5-26 Sample Wood Building Materials Read by CAT Plug-in (A) 174 Figure 5-26 Sample Wood Building Materials Read by CAT Plug-in (B) Then after running EC3, all the materials that EC3 can read are displayed on the building information UI (Fig. 5-27). 175 Figure 5-27 Sample Wood Building Materials Read by EC3 (A) Figure 5-27 Sample Concrete and Brick Building Materials Read by EC3 (B) Therefore, it can be seen that EC3 can read more types of materials like Windows, Doors, and Planting, and the CAT plug-in can’t read these kinds of materials (Fig. 5- 28). Figure 5-28 The Materials That Cannot Read by CAT Plug-in but EC3 176 5.4.4 Comparison of Ability to Read Layers of Materials Most materials have different layers with different thicknesses, like most walls (Fig. 5- 29). Compared with EC3, the CAT plug-in can read all the layers and display them respectively with their volume while EC3 only can read the entire wall name (Fig. 5- 30). Figure 5-29 Different Layers of the Wall 177 Figure 5-30 CAT Plug-in’s Ability to Read Different Layers Compared to the CAT plug-in, EC3 is not able to automatically read the various layers of walls, it can only read the entire name of walls instead. For example, as for sample concrete and brick building, EC3 can only read three different walls: XS wall with Cherry, XS wall 1, and XS wall 2. But as mentioned above, there are different layers in each wall like the XS wall with Cherry, and EC3 cannot read those layers (Fig. 5-31). 178 Figure 5-31 Different Names of Entire Walls Read by EC3 5.4.5 Comparison of the Volume of Each Read Material As for the sample concrete and brick building, a table was made to compare the differences between the two software readings for each material (Table 5-2). Family Material: Result Material Type Results of CAT Plug-in Results of EC3 Percentage of Difference Wall Concrete, Cast-in- Place gray XS wall 2 810.7 CF 1216 CF 1216 CF 0% Cherry 270.2 CF 179 Brick, Soldier Course 135.1 CF Concrete, Precast XS wall 1 412.3 CF 1434.6 CF 80938 m3= 2,857,273.5 CF 198.2% Brick, Common 68.7 CF Concrete, Precast 817.3 CF Brick, Common 136.2 CF Concrete, Precast XS wall with Cherry 415.7 CF 726.06 CF 43129.2 m3= 1,523,029.6 CF 200.0% Brick, Common 69.3 CF Cherry 277.1 CF Floor Concrete, Cast-in- Place gray XS FLOOR 1 1681.9 CF 1681.9CF 0% Roof Metal Deck XS ROOF 1 133.3 CF 8800.0 CF 11466.7 kg 180 Structure, Steer Bar Joist Layer 8533.3 CF Roofing, EPDM Membrane 133.3 CF Framing Stainless Steel W12 ×26 2.7 CF 6.4 CF 1352 kg=6.1 CF 6.0% Stainless Steel 2.7 CF Stainless Steel 1.01 CF Columns Plywood, Sheathing Plywood, Sheathing 0.9 CF 0.02 m3= 0.7 CF 25% Glass Glass 0.9 CF 2.7 CF 188.9 kg= 2.7 CF 0% Glass 0.9 CF Glass 0.9 CF Table 5-2 Comparison Table of the Results of the Two Software As for sample wood building, a table was made to compare the differences between the two software readings for each material (Table 5-3). 181 Family Material: Result Material Type Results of CAT Plug-in Results of EC3 Percentage of Difference Wall Softwood, Lumber XS wall 2 810.7 CF 1216 CF 1216 CF 0% Cherry 405.3 CF Plywood, Sheathing XS wall 1 412.3 CF 1434.5 CF 1434.6 CF 0.007% Softwood, Lumber 68.7 CF Plywood, Sheathing 817.3 CF Softwood, Lumber 136.2 CF Plywood, Sheathing XS wall with Cherry 69.3 CF 726.1 CF 444.6 CF 48.06% Softwood, Lumber 415.7 CF Cherry 277.1 CF 182 Floor Softwood, Lumber XS FLOOR 1 1681.94 CF 1681.94CF 0% Roof Plywood, Sheathing XS ROOF 1 133.3 CF 11333.3 CF 25.5 m3= 900.1 CF 168.9% Softwood, Lumber 8533.3 CF Cherry 2666.7 CF Framing Softwood, Lumber W12 ×26 2.7 CF 6.4 CF 3.7 CF 53.46% Softwood, Lumber 2.7 CF 1.01 CF Columns Plywood, Sheathing W 10 ×49 0.9 CF 3.6 CF 3.6 CF 0% Plywood, Sheathing 0.9 CF Plywood, Sheathing 0.9 CF Plywood, Sheathing 0.9 CF Table 5-3 Comparison Table of the Results of the Two Software 183 According to the two tables above, for materials with only one layer, the percentage of the difference between the results of the CAT plug-in and the results of EC3 is almost equal to 0. However, for materials with multiple layers, the percentage of the difference between the results of the CAT plug-in and the results of EC3 is significant and all the yellow cells in the table above represent that the percentage of difference is more than 25%. The reason for this is that EC3 cannot read the different layers but the CAT plug- in can, which leads to the difference in results. 5.4.6 Comparison of Output The graphic output of the Embodied Carbon Calculator for Construction (EC3) typically provides a range of visual representations of the carbon footprint of a building or infrastructure project. The EC3 output includes a variety of graphs and charts that provide a detailed breakdown of the embodied carbon emissions of different building components, such as walls, floors, roofs, and foundations. This breakdown can help identify which components contribute most to the overall carbon footprint of the project and where efforts can be focused to reduce emissions. One of the most common visualizations in EC3 is a stacked bar chart that shows the embodied carbon emissions of each building component, with each bar divided into different colors representing the carbon emissions from different stages of the product 184 life cycle, such as manufacturing, transportation, and disposal. This type of chart can help identify which stages of the product life cycle are responsible for the most emissions and where improvements can be made (Fig. 5-32). Figure 5-32 A Stacked Bar Chart in EC3 EC3 also provides other types of diagrams like a Sankey diagram (Fig. 5-33). The GWP (Global Warming Potential) Sankey diagram in the Embodied Carbon Calculator for Construction (EC3) is a visual representation of the carbon footprint of a building or infrastructure project. The Sankey diagram is a type of flow diagram that shows the flow of a particular substance or resource (in this case, carbon emissions) through different stages of a system. In the context of the Embodied Carbon Calculator for Construction (EC3), the Sankey diagram shows the flow of embodied carbon emissions associated with the construction of a building or infrastructure project. 185 Figure 5-33 GWP (Global Warming Potential) Sankey diagram The thickness of the lines in the diagram represents the magnitude of the carbon emissions associated with each material. By visualizing the flow of embodied carbon emissions, the diagram can help identify which choices of materials might need closer study. Overall, the Sankey diagram in the EC3 is a useful tool for understanding the different material components of the carbon footprint. The biggest difference between the CAT plug-in and EC3 in their output is that the CAT plug-in not only can calculate the embodied carbon of a building but also can consider how many years, how many trees, how much weight of trees and what type of trees it would take to reach the goal from a sustainability perspective if the building needs to be carbon neutral using the tree planting method. The Second UI will show the output of the carbon neutrality method and its results. And if the target is not reached, the 186 building owner needs to do carbon trading so the plug-in also sets up a carbon trading function, that is, it calculates the amount of carbon sequestered by the trees to offset the embodied carbon content of the building, and the remaining is needed to buy carbon credit in the carbon trading market to offset (Fig. 5-34). Figure 5-34 Carbon Neutrality and Trading Function in CAT Plug-in 5.5 Analysis of Errors and Differences Generally, both of them are tools for assessing the carbon footprint of building materials by reading material information from a building model to calculate the building's carbon footprint. When using them, the following errors and differences may exist: 1. Material data errors: they use building material data based on industry averages or data provided by manufacturers, which may not be fully accurate or applicable to a 187 particular project. Therefore, there may be errors in the carbon emissions data calculated by them. 2. Model geometry errors: they need to read the material information in the building model and combine it with the geometric information of the building model to calculate the carbon emission data. If the geometric information in the model is inaccurate or missing, the carbon emission data calculated by them will also have errors. 3. Energy data error: they need to consider the energy consumption in the production and transportation of building materials when calculating carbon emission data. These energy data may be based on estimates or industry averages, so there may be errors. 4. Assumption error: they need to calculate carbon emission data based on some assumptions, such as the energy sources in the production and transportation of construction materials. If these assumptions do not match the actual situation, the carbon emission data calculated by them will also be inaccurate. 5. Conversion error: CAT plug-in reads materials by volume and uses CF as the default unit, while EC3 reads some materials by area or even length, which brings some conversion errors. In conclusion, when using these two tools for building carbon footprint assessment, it 188 is necessary to input material information and geometric information in the building model, as well as energy data and other information as accurately as possible, and to reasonably handle factors such as assumptions and calculation methods to minimize the occurrence of errors. 5.6 Summary This chapter discusses the embodied carbon calculator for construction (EC3), discusses the sample building- concrete and the sample building-wood, and provides an overall comparison and analysis of the two software programs. In the embodied carbon calculator for construction (EC3) part, the simple differences between EC3 and CAT plug-in are listed. As for the sample concrete and wood building parts, two different calculation tools are used for both sample buildings separately. From the analysis of data, the two results obtained for two different material types of buildings are close to each other for the two sample files (12.7% and 4.5%). For the overall comparison and analysis of the two tools, the comparison of sample concrete and wood building results, interface, ability to read more Revit components, ability to read layers of materials and volume of each read material was made. The errors may be caused by material data errors, model geometry errors, energy data errors, assumption errors, and conversion errors. 189 It was found that it was quick and easy to compare the carbon content of wood and concrete in CAT. Wood buildings have significantly lower embodied carbon content than concrete buildings, which is important to consider for the development of low- carbon buildings in the future. The embodied carbon content of concrete buildings is about 350 times higher than that of wood buildings, reflecting the environmental friendliness of wood buildings. Wood buildings also have the advantages of being lightweight, high strength, flexible, and natural beauty, which indicates that in the future, if people want to reduce the amount of carbon trading purchases, they can use more low-carbon building materials such as wood structures and test their choices in programs like EC3 and CAT. 190 Chapter 6: Conclusions and Future Work This chapter includes a discussion of the workflow to create the Carbon Accounting Tool (CAT), CAT features, current limitations, and future work, which summarizes the evaluation of the workflow and analyzes the current limitations of the tool, improvements, and future work. A summary of the methodology includes the creation of the CAT Revit plug-in and its use to calculate embodied carbon and carbon neutrality pricing using trees for sequestration. After analyzing BIM, Revit API, carbon neutrality, carbon trading, and tree database, a Revit plug-in CAT was developed. After creating the C# programming language environment, use .NET 6.0 Framework to build the library and link the corresponding .dll files such as RevitAPI.dll to program the module interface and algorithm for constructing the CAT plug-in. In the first interactive interface, the plug-in can read the information about the building materials, define Carbon Unit Sheet and Tree Sheet in advance, isolate the materials that have been read in the current building model, hide the materials that have not been read, and also display the final calculation result, i.e., the total embodied carbon content of the current building. Using this data in the second user interface, set the year of the building carbon neutrality, select the appropriate number and type of trees in combination with climate zones or select the appropriate mass of trees for carbon offsetting, the excess carbon will be displayed at the bottom of the interface, and the final amount of money needed for the carbon trading can be derived with the carbon credit price set. 191 6.1 Discussion of the Workflow CAT is a plug-in written for use with Revit through the Revit API for creating an interface to enable a plug-in to determine the carbon footprint and the approximate amount of landscaping to offset it. The workflow had three main parts: establishment of the environment for the Revit.API development, writing the code, demonstrating how to use the software in the form of a case study, and validation versus EC3 (Fig. 6- 1). In addition, a comparison of EC3 and CAT was done. Figure 6-1 Workflow BIM allows for parameters to be associated with objects (such as materials associated 192 with walls), can take off quantities (such as cubic feet of concrete), and a robust API to create new tools (for example, the plug-in). External databases such as embodied carbon and tree values were added. CAT was developed through the Revit API to read the material details of a simple building with “basic layered” walls, roof, floors, and columns, and calculate the total embodied carbon of the building. This was combined with the carbon emission of the building operation throughout the year to get the total carbon emission of the building. Then the carbon offset was calculated. Although embodied and operational carbon are created throughout the lifecycle of the building, several software programs tend to focus on the materials of construction, which play a large role. This method, although not covering all phases of life-cycle assessment, calculated the amount of material in a building to determine the number of carbon trade-offs. The planting of trees for offsets is one way to achieve carbon neutrality. The Revit SDK 2023, Revit Lookup, and AddInManager were configured to build a C# programming language environment and the Revit API was developed using the .NET 6.0 Framework. After the interaction between VS and Revit, the plug-in was divided into two user interfaces. In the first user interface, code was written to read the Revit model material information and performed the current building material embodied carbon calculation based on the custom criteria. In the second user interface, carbon offsets were performed by planting trees with user-defined criteria for carbon dioxide 193 sequestration of different tree species or masses. Finally, users can enter the current carbon credit price in the carbon market to check how much the building owner has to pay for the remaining carbon emissions of the current building after the carbon offsetting with tree count or tree mass method in the second user interface. In the “getting starting” guide section in Chapter 4, the guide begins by downloading the Visual Studio file and Revit file, opening a sample building file in Revit, and opening external tools in Revit Add-Ins. The user interface (UI) is explained and how the 3d model can be viewed showing only the components that will be considered for the calculation of the embodied carbon. Afterward, it discusses how to deal with the “Unknown” and layers of materials problem. Furthermore, both the carbon unit sheet and tree sheet are pre-defined with some materials, and the user can add more. Then the second UI page comes up that deals with the issue of carbon sequestration through trees; one can use the tree count method or tree mass method for carbon neutrality and at last do the carbon trading if needed. In the carbon accounting results section, a sample house was shown and accompanied by lists and images of all the Revit components that will be in the calculation, isolation of only those components being included in the calculation, pre-defined materials with embodied carbon content, total embodied carbon calculation, pre-defined trees on the tree sheet, and tree count and tree mass methods in the second UI. 194 Validation was performed by comparing the carbon results from CAT by using two simple buildings, one concrete, and one wood. As for the sample concrete and wood building parts, two different calculation tools are used for both sample buildings separately. From the analysis of data, the two results obtained for two different material types of buildings are close to each other with a percentage difference of 4.5% and 12.3%. The errors may be caused by material data errors, model geometry errors, energy data errors, assumption errors, and conversion errors. This exercise also showed that it is fairly simple to change the materials of the building and get quick feedback. 6.2 CAT Features In the first user interface, the plug-in can read the information about the building materials, pre-define a Carbon Unit Sheet and a Tree Sheet (Fig. 6-2), isolate the materials that have been read in the current building model, hide the materials that have not been read (Fig. 6-3), and also display the total value of embodied carbon of the current building (Fig. 6-4). 195 Figure 6-2 Material Information, Tree Sheet, and Carbon Unit Sheet on the First UI Figure 6-3-1 Isolation Button (lower left corner), Not Isolated, Isolated 196 Figure 6-4 Total Value of Embodied Carbon Moreover, in terms that currently most of the materials have multiple layers like most of the walls have different layers inside (Fig. 6-5), the CAT plug-in has the ability to read these various layers of building materials in a Revit “Basic Wall” (Fig. 6-6). 197 Figure 6-5 Basic Wall with Three Different Layers Figure 6-6 Layers’ Readout Results in CAT Plug-in Currently, the CAT plug-in can read information about building structure materials, such as columns, floors, roofs, framing systems, and walls (Table 6-1). 198 Table 6-1 Components List That CAT Plug-in Can or Cannot Read In the second user interface, the total tree sequestration will be calculated according to the total value calculated in the first UI, setting how many years to accomplish carbon neutrality and selecting the appropriate number and type of trees in combination with Climate Zones or selecting the appropriate mass of trees for carbon offsetting, Subsequently, the excess carbon will be displayed at the bottom of the interface, and 199 the final amount of money needed for the carbon trading can be derived with the Carbon Credit price set (Fig. 6-7). Figure 6-7 Second UI of CAT Plug-in Every blank on the second UI where data can be entered or exported is represented in capital letters, which describes the process of carbon neutrality and carbon trading (Fig. 6-8). A. Total embodied carbon of the current building that was calculated in the previous interface. B. The number of years that the building to accomplish the carbon neutrality C. Total sequestration of selected trees after multiplying by the set number of years D. Surplus, means the rest of the carbon needs trading after the offset is incorporated E. Carbon credit price in the carbon market 200 F. The cost of the carbon trading that the building owner or enterprise should pay if the building doesn’t reach the target of carbon neutrality. Therefore, A-C=D, and D ×E=F. Figure 6-8 Second UI of CAT Plug-in 6.3 Current Limitations of the Tool The Carbon Accounting Tool (CAT) is a tool for calculating the emissions of building materials that can help designers and architects reduce their carbon footprint when constructing new buildings. However, the tool has several limitations including the following: 1. Incomplete data: The CAT plug-in relies on data about materials that is input by the user. It does not include how they are produced, how far they are transported, etc., and the data provided by the users may be incomplete or inaccurate. As a result, the calculations may not be completely accurate. 201 2. Accuracy limitation: The CAT plug-in only reads the main structural materials like columns, floors, roofs, framing systems, and walls and cannot take all Revit components into account, which will make the result less accurate and complete. 3. Scope limitation: The CAT plug-in only considers the embodied carbon part in the whole life-cycle of building materials and does not consider emissions from the operation and maintenance phases of a building. Therefore, it does not fully reflect the overall carbon footprint of a building. The operating footprint can be calculated by a simulation of the building described. 4. Factors external to the building industry: The carbon emissions of a building are also influenced by factors external to the building industry, such as policies, markets, and technological advances. These factors may influence the design and material selection of a building, which in turn may affect its emissions. However, the CAT plug-in is unable to take these factors into account. 5. Carbon neutrality methods limitation: There are many ways to be carbon neutral, but the CAT plug-in's carbon neutrality and carbon trading modules only consider planting a specified number and type of trees or a specified mass of trees to be carbon neutral, i.e., using landscaping for carbon offsets. However, there are many other methods of carbon neutrality, such as burying carbon deep in the ground and other methods. Due 202 to the limitations of the plugin's functional design, the CAT plug-in considers only one method of planting trees for carbon sequestration. 6. Trees’ sequestration limitation: Of the two methods of tree carbon sequestration, selecting the appropriate tree, different species of trees, or selecting the appropriate weight of trees, this plug-in can only select one for the carbon neutrality of the building. Therefore, the limitation is that if the first method is selected, each tree will have its specific growth age, and the amount of carbon sequestered will increase from small to large with the age of the tree, so it is not accurate. If the latter is chosen, the direct selection of trees of corresponding weight can indeed avoid the problem of tree growth age, but the same weight and carbon sequestration of different kinds of trees will also vary, so both methods will have certain errors and limitations in the results. 6.4 Future Work This section discusses a few methods for improving the CAT plug-in and other ideas for methods of carbon sequestration. 6.4.1 Improvements to the Tool After trying EC3 and considering other approaches, it is apparent that several smaller improvements can be made to the CAT plug-in. 1. Current carbon accounting tools can only read the main structure of the building 203 like walls, framing work, columns, floors, and roofs. For a plug-in running in Revit, a perfect adaptation to Revit is a very important part. Usually, a complete Revit building model has many other components besides the mentioned main structure, such as glass curtain walls, interior furniture, stairs, outdoor site design, MEP, and so on, all of which will generate embodied carbon in the actual construction. Therefore, the plug-in that can take all the factors into account can be perfectly adapted to Revit and used in the future in real large-scale projects. 2. For the current CAT plug-in, the user can only customize the materials and the amount of embodied carbon per unit in the Carbon Unit Sheet and Tree Sheet in advance, and then run the read model to read the corresponding materials and data, otherwise it will show “Unknown” and the result will be 0. In the future, if people need to import the material unit sheet more easily, the CAT plug-in can link directly to the external sheet and automatically read the data in the sheet, thus serving as a baseline to read the building materials and data. For example, as for building materials, expand EPDs like EC3 to the plugin's database or externally linked EPDs database. As for the tree sequestration method, the tree database often has a large amount of data, which can take a lot of time to enter, so linking directly to an Excel sheet with a large database could be more convenient and efficient. 3. In the first display module of the plugin, there is a button in the lower left corner that isolates the currently read construction materials and hides the unread materials. 204 In the future, to make the plug-in visualization more advanced and significant, and to increase the interaction between the plug-in and the user, the model can be transformed into graphic display options: wireframe or hidden line, and then the read materials will be automatically colored, and the unread ones will not be colored. In a more advanced way, the reading material can be divided into different colors according to the embodied carbon content of the material as a percentage of the total embodied carbon content of the building, so that people can easily recognize it. 4. The resulting output of the CAT Plug-in is mainly numerical, and its output results are displayed directly as values in the blank cell of the plug-in UI. While EC3 can directly output various types of images, such as GWP Sankey and Bar Chart. The EC3 output includes a variety of graphs and charts that provide a detailed breakdown of the embodied carbon emissions of different building components, such as walls, floors, roofs, and foundations. This breakdown can help identify which components contribute most to the overall carbon footprint of the project and where efforts can be focused to reduce emissions. In future plug-in development, the plug-in can be given the ability to do the visualization graphic output by continuing to develop the functionality of this plug-in. For example, providing heat maps and color-coded maps that show the geographic distribution of embodied carbon emissions for the building materials used in a project. This type of visualization could help to build designers identify regions where the carbon 205 footprint of the materials is highest and where the sourcing of materials can be optimized to reduce emissions. Although making these improvements would increase the functionality of CAT, it might not be the best use of time and other recourses. For example, it might be better to make the software more user-friendly and have larger material databases pre-defined to focus the tool on being more for early design decisions or use as a teaching tool. Or instead, focus more on improving the features of carbon trade-offs that are more unique to this program. This may be the focus of an improved tool instead, and data about embodied carbon totals could just be imported from other software. A full life-cycle assessment program is probably beyond the capabilities of a Revit plug-in. 6.4.2 Improvements to Sequestering of Carbon Several improvements could be made specifically to the carbon sequestering part of the tool. They fall broadly into two categories: more nuanced tree calculations and other non-tree methods. The current carbon accounting plug-in focuses on using two methods of carbon offsetting: different types of trees and different weights of trees corresponding to different amounts of carbon sequestration. For the selection of trees, besides considering USDA Climate Zones, the water demand, and ideal temperature can be 206 summarized in the tree database for longitudinal comparison by the building owners or enterprises. In terms of the carbon accounting tool only considers the use of selected different types of trees or selected different weights of trees to accomplish carbon sequestration. Many other tree features can be selected by the building owner or enterprise as an important method of carbon sequestration: hybrid calculation method, water requirements of plant species, temperature ranges of tree species, and non- landscape methods. Hybrid Calculation Method. In the second display module of the plug-in for carbon neutrality, the CAT plug-in considers carbon neutrality using the selection of the appropriate number of trees, different types of trees, or the selection of the appropriate weight of trees. However, due to the limitations of the plug-in design, only one of them can be selected for carbon neutralization, which means that if the first one is selected, there will be an error in the carbon sequestration due to the age of the trees, and if the second one is selected, there will be an error in the carbon sequestration of the same weight of trees due to the different types. In future work, it would be useful to integrate the two methods, taking into account the type, age, and weight of the trees, to provide users with a choice that would reduce the carbon sequestration error, which implies the need for a large, systematic, and accurate database to support. Water Requirements of Plant Species. Each tree has a different daily and annual water requirement, and the building owner or enterprise can effectively select trees with low 207 or high water requirements depending on the drought or flood level of the area of the building. The water footprint is an important determinant for the selection of trees related to water demand (Fig. 6-4). Figure 6-9 The Average (production-weighted) Water Footprint Per Unit of Roundwood Production (m 3 water/ m 3 roundwood) For the Main Roundwood Producing Countries. Period: 1961-2010 (Thunder Said Energy-CO2 Uptake Rates by Tree Type, 2022) The water footprint is generally between 100-600/ m 3 of water per m 3 of wood in various regions globally and less in more arid regions (Thunder Said Energy-CO2 Uptake Rates by Tree Type, 2022). Temperature ranges of tree species. Each tree has its appropriate growing temperature, and trees within this temperature range can be selected according to the year-round 208 temperature of the building site. A suitable environment can maximize the carbon sequestration effect of the trees. Although this is similar to the climate zone used in the CAT tool for tree selection, the climate zone includes not only the appropriate growing temperature of the tree) Fig. 6-5), but also the soil, precipitation, etc. Tree Name Minimum Temperature Ideal Temperature Maximum Temperature Norway fir -34 18.0 24 Silver maple -30 19.0 27 Horse chestnut -40 19.8 30 Scots pine -60 20.0 50 European beech -29 20.0 27 European oak -30 20.0 30 European larch -50 21.0 30 Linden -40 21.6 33 Quaking aspen -40 22.0 40 Black alder -40 22.0 44 Giant redwood -23 23.9 40 Empress tree -25 24.0 35 Eucalyptus -5 25.0 35 Red mangrove -4 25.0 37 Bamboo -2 25.0 50 209 Date palm 0 25.3 50 Lemon tree -3 27.0 45 African acacia -1 27.5 45 Teak 0 27.0 45 Ceiba Kapok -1 28.0 40 Figure 6-10 Minimum, Ideal and Maximum Temperature of Different Trees (Thunder Said Energy-CO2 Uptake Rates by Tree Type, 2022) Minimum temperatures are those that will effectively limit the tree's growth to next to nothing or kill it; Maximum is the level at which growth will be severely curtailed. Non-landscaping methods. In the future, if the plug-in needs to be applied in large projects, the carbon accounting part of the plug-in needs to have a more mature and comprehensive carbon offset selection method. Currently, the CAT plug-in uses landscaping as the only method to do carbon sequestration, which offsets the embodied carbon of the building. However, there are many other ways to sequester carbon. 1. Soil: Some bogs and peats can capture carbon and store it as carbonates (What Is Carbon Sequestration and How Does It Work? | CLEAR Center, n.d.). 2. Oceans: Some environments with water and large water areas such as lakes and oceans also absorb huge amounts of CO2. Lakes and oceans hold about 1/4 of the 210 Earth's CO2 emissions. This carbon dioxide is usually stored in the upper layers of the oceans, so too much carbon can lead to acidification of seawater, which can damage or destroy the entire living environment of the oceans (What Is Carbon Sequestration and How Does It Work? | CLEAR Center, n.d.). 3. Graphene production: Geological carbon sequestration is also a good method to sequester carbon purely in the underground in places such as rocks. Carbon dioxide can be used to produce graphene and broaden the use of graphene (What Is Carbon Sequestration and How Does It Work? | CLEAR Center, n.d.). 4. Engineered molecules: This is a new technology that can capture the carbon in the air and form the new chemical compound, which means it can create the raw materials or ingredients in this way. After capturing, the CO2 gets compressed, transported to the deep underground, and injected into the rock (What Is Carbon Sequestration and How Does It Work? | CLEAR Center, n.d.). 6.5 Summary This chapter included a discussion of the workflow to create CAT, CAT features, current limitations, and future work. The CAT plug-in was developed for Revit for embodied carbon calculation and carbon accounting. Currently, it can calculate the total value of embodied carbon of the main structural material of the building. The validation against EC3 showed under 15% difference in results. Many suggestions were given on how to 211 improve it. In the future, the CAT plug-in can be improved, enhanced and made more practical in many areas, such as distinguishing materials with high embodied carbon content from those with low embodied carbon content by color, optimizing the carbon neutral method of planting trees, adding more carbon neutral methods, etc. Through the Revit API, Revit and Visual Studio can be related, and related programs on Visual Studio as External Command of Revit were written to design a plug-in that can run on Revit like how Revit Lookup was developed. The CAT plug-in can read the material details of a building and calculate the embodied carbon including an interface to enable the user to determine the carbon footprint and the approximate amount of landscaping to offset it. The limitations of the tool include incomplete data, accuracy limitation, scope limitation, and external factors that influence the carbon emissions of a building. Future work includes developing more accurate data sources and expanding the scope of the tool to cover other phases of a building's life cycle. The results obtained from CAT plug-in mainly covers initial embodied carbon in the construction materials. Compared to other software with similar functions, the unique feature of CAT plug-in is that it can directly use the corresponding carbon sequestration method to carbon neutralize the building after calculating the total amount of embodied carbon in the building, and then decide whether to trade in the carbon market. CAT plug-in, as a low-carbon design tool, is another step that could help designers understand the carbon footprint of their buildings. By integrating low-carbon design 212 principles into even more advanced tools, one could empower architects, engineers, and designers to make more informed decisions when designing buildings and infrastructure. Low-carbon design has a significant impact on the environment in several ways: reducing greenhouse gas emissions, conserving resources, improving air and water quality, and encouraging sustainable behavior. In addition to reducing greenhouse gas emissions and combating climate change, a low-carbon design tool could also have positive social and economic impacts. By prioritizing sustainable materials and energy-efficient systems, buildings could be healthier and more comfortable for occupants, while also reducing energy costs over the long term. Moreover, a carbon calculating tool that runs in BIM also can improve accuracy, enhance collaboration, better material choices, and improve building lifecycle management. It may be able to do this because it works with tools that architects already use. The CAT plug-in also is a step towards incorporating carbon trade-offs into carbon calculation tools. In the future, more sophisticated tools can help clients understand the choices dealing with carbon neutrality and carbon offsetting, which can reduce the impact of carbon emissions on the environment and mitigate the effects of climate change. By achieving carbon neutrality, entities can reduce their overall carbon footprint and minimize their impact on the environment. Carbon offsetting provides a mechanism for entities to take responsibility for their carbon emissions and to support projects that reduce greenhouse gas emissions and promote sustainable development; otherwise, they should be responsible for carbon trading. 213 References 3 - Targeting Net-Zero Embodied Carbon - Carbon Leadership Forum. (2022). https://carbonleadershipforum.org/targeting-net-zero-embodied-carbon/ About the National BIM Standard-United States® V4 | National BIM Standard - United States. (2022). https://www.nationalbimstandard.org/about Alshomer, F., Alfaqeeh, F., Alariefy, M., Altweijri, I., & Alhumsi, T. (2019). Low-Cost Desktop-Based Three-Dimensional-Printed Patient-Specific Craniofacial Models in Surgical Counseling, Consent Taking, and Education of Parent of Craniosynostosis Patients: A Comparison With Conventional Visual Explanation Modalities. Journal of Craniofacial Surgery, 30(6), 1652–1656. https://doi.org/10.1097/SCS.0000000000005401 An energy sector roadmap to carbon neutrality in China – Analysis - IEA. (n.d.). Retrieved April 16, 2023, from https://www.iea.org/reports/an-energy-sector-roadmap-to-carbon- neutrality-in-china Are Humans the Major Cause of Global Warming? | Union of Concerned Scientists. (2022). https://www.ucsusa.org/resources/are-humans-major-cause-global-warming BIM program aims to boost construction’ s digital transformation | Construction Dive. (2022). https://www.constructiondive.com/news/national-bim-program-aims-boost- digital-transformatio/633840/ Boukili, V . K. S., Bebber, D. P., Mortimer, T., Venicx, G., Lefcourt, D., Chandler, M., & Eisenberg, C. (2017). Assessing the performance of urban forest carbon sequestration models using direct measurements of tree growth. Urban Forestry & Urban Greening, 24, 212–221. https://doi.org/10.1016/J.UFUG.2017.03.015 Carbon Accounting Methodologies for Measuring Emissions - Net0. (2022). https://net0.com/blog/carbon-accounting-methodologies Carbon Credit Pricing Chart: Updated September 2023. (n.d.). Retrieved February 16, 2023, from https://8billiontrees.com/carbon-offsets-credits/new-buyers-market- guide/carbon-credit-pricing/ Carbon Pricing Dashboard | Up-to-date overview of carbon pricing initiatives. (2022). https://carbonpricingdashboard.worldbank.org/map_data China’ s Transition to a Low-Carbon Economy and Climate Resilience Needs Shifts in Resources and Technologies. (2022). https://www.worldbank.org/en/news/press- 214 release/2022/10/12/china-s-transition-to-a-low-carbon-economy-and-climate- resilience-needs-shifts-in-resources-and-technologies CLF Embodied Carbon Toolkit for Building Owners - Carbon Leadership Forum. (2022). https://carbonleadershipforum.org/clf-owner-toolkit/#owner-commitments Climate Reports | United Nations. (2022). https://www.un.org/en/climatechange/reports DesignScript Syntax | The Dynamo Primer. (2022). https://primer.dynamobim.org/07_Code- Block/7-2_Design-Script-syntax.html Durão, V ., Silvestre, J. D., Mateus, R., & de Brito, J. (2020). Assessment and communication of the environmental performance of construction products in Europe: Comparison between PEF and EN 15804 compliant EPD schemes. Resources, Conservation and Recycling, 156, 104703. https://doi.org/10.1016/J.RESCONREC.2020.104703 Elements of RGGI | RGGI, Inc. (2022). https://www.rggi.org/program-overview-and- design/elements Embodied Carbon in Construction Calculator (EC3) - CarbonCure. (2022). https://www.carboncure.com/concrete-corner/embodied-carbon-in-construction- calculator-ec3/ Environmental Product Declarations And Product Category Rules - References - Sustainable Pavement Program - Sustainability - Pavements - Federal Highway Administration. (2022). https://www.fhwa.dot.gov/pavement/sustainability/articles/environmental.cfm EPD International. (2022). https://www.environdec.com/home Executive summary – An energy sector roadmap to carbon neutrality in China – Analysis - IEA. (n.d.). Retrieved April 16, 2023, from https://www.iea.org/reports/an-energy- sector-roadmap-to-carbon-neutrality-in-china/executive-summary F ACT SHEET: President Biden Sets 2030 Greenhouse Gas Pollution Reduction Target Aimed at Creating Good-Paying Union Jobs and Securing U.S. Leadership on Clean Energy Technologies | The White House. (n.d.). Retrieved April 16, 2023, from https://www.whitehouse.gov/briefing-room/statements-releases/2021/04/22/fact- sheet-president-biden-sets-2030-greenhouse-gas-pollution-reduction-target-aimed-at- creating-good-paying-union-jobs-and-securing-u-s-leadership-on-clean-energy- technologies/ How to calculate the amount of CO 2 sequestered in a tree per year. (2022). Is Beacon Technology in Your Company’ s Future? | Blog - BairesDev. (2022). https://www.bairesdev.com/blog/future-beacon-technology/ Lesson 1: The Basic Plug-in | Search | Autodesk Knowledge Network. (2022). 215 https://knowledge.autodesk.com/search-result/caas/simplecontent/content/lesson-1- the-basic-plug.html Muralikrishna, I. v., & Manickam, V . (2017). Life Cycle Assessment. Environmental Management, 57–75. https://doi.org/10.1016/B978-0-12-811989-1.00005-1 New California law addresses embodied carbon | U.S. Green Building Council. (2022). https://www.usgbc.org/articles/new-california-law-addresses-embodied-carbon NJDEP | Regional Greenhouse Gas Initiative (RGGI) | Air Quality, Energy and Sustainability (AQES). (2022). https://www.nj.gov/dep/aqes/rggi.html Offsets | RGGI, Inc. (2022). https://www.rggi.org/allowance-tracking/offsets One Click LCA | Revit | Autodesk App Store. (2022). https://apps.autodesk.com/RVT/en/Detail/Index?id=3065869958781255107&appLan g=en&os=Win64 Peng, C., & Wu, X. (2015). Case study of carbon emissions from a building’s life cycle based on BIM and Ecotect. Advances in Materials Science and Engineering, 2015. https://doi.org/10.1155/2015/954651 Reeder, L. (2011). Guide to Green Building Rating Systems: Understanding LEED, Green Globes, Energy Star, the National Green Building Standard, and More. Guide to Green Building Rating Systems: Understanding LEED, Green Globes, Energy Star, the National Green Building Standard, and More, 1–222. https://doi.org/10.1002/9781118259894 Regional Greenhouse Gas Initiative (RGGI) - Center for Climate and Energy SolutionsCenter for Climate and Energy Solutions. (2022). https://www.c2es.org/content/regional-greenhouse-gas-initiative-rggi/ RICS Methodology to calculate embodied carbon of materials. (2012). www.ricsbooks.com Röck, M., Saade, M. R. M., Balouktsi, M., Rasmussen, F. N., Birgisdottir, H., Frischknecht, R., Habert, G., Lützkendorf, T., & Passer, A. (2020). Embodied GHG emissions of buildings – The hidden challenge for effective climate change mitigation. Applied Energy, 258, 114107. https://doi.org/10.1016/J.APENERGY .2019.114107 Saunois, M., R. Stavert, A., Poulter, B., Bousquet, P., G. Canadell, J., B. Jackson, R., A. Raymond, P., J. Dlugokencky, E., Houweling, S., K. Patra, P., Ciais, P., K. Arora, V ., Bastviken, D., Bergamaschi, P., R. Blake, D., Brailsford, G., Bruhwiler, L., M. Carlson, K., Carrol, M., … Zhuang, Q. (2020). The global methane budget 2000-2017. Earth System Science Data, 12(3), 1561–1623. https://doi.org/10.5194/ESSD-12-1561-2020 Schaltegger, S., & Csutora, M. (2012). Carbon accounting for sustainability and 216 management. Status quo and challenges. Journal of Cleaner Production, 36, 1–16. https://doi.org/10.1016/J.JCLEPRO.2012.06.024 Supported Programming Languages | Revit | Autodesk Knowledge Network. (2022). https://knowledge.autodesk.com/support/revit/learn- explore/caas/CloudHelp/cloudhelp/2014/ENU/Revit/files/GUID-FEF0ED40-8658- 4C69-934D-7F83FB5D5B63-htm.html Types of Building Materials Used in Construction. (2022). https://structuralengineeringbasics.com/what-types-of-construction-building- materials/ What Is BIM | Building Information Modeling | Autodesk. (2022). https://www.autodesk.com/industry/aec/bim What is carbon neutrality and how can it be achieved by 2050? | News | European Parliament. (2022a). https://www.europarl.europa.eu/news/en/headlines/society/20190926STO62270/what- is-carbon-neutrality-and-how-can-it-be-achieved-by-2050 What is carbon neutrality and how can it be achieved by 2050? | News | European Parliament. (2022b). https://www.europarl.europa.eu/news/en/headlines/society/20190926STO62270/what- is-carbon-neutrality-and-how-can-it-be-achieved-by-2050 What is Carbon Sequestration and How Does it Work? | CLEAR Center. (n.d.). Retrieved March 7, 2023, from https://clear.ucdavis.edu/explainers/what-carbon-sequestration What Is Carbon Trading? How Did It Come About? | by Sabrina Lerskiatiphanich | Carbonbase | Medium. (2022). https://medium.com/carbonbase/what-is-carbon- trading-how-did-it-come-about-793d01d89f02 What next for AEC software? - AEC Magazine. (2022). https://aecmag.com/construction/what-next-for-aec-software/ Yang, Y ., Pan, Y ., Zeng, F., Lin, Z., & Li, C. (2022). A gbXML Reconstruction Workflow and Tool Development to Improve the Geometric Interoperability between BIM and BEM. Buildings 2022, Vol. 12, Page 221, 12(2), 221. https://doi.org/10.3390/BUILDINGS12020221 217 Appendix A Figure 1-15-1 Appendix Carbon Software and Tools Matrix (1) 218 Figure 1-15-2 Appendix Carbon Software and Tools Matrix (2) 219 B AssemblyInfo.cs using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("CarbonEmissio")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CarbonEmissio")] [assembly: AssemblyCopyright("Copyright © 2022")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("e7e4d980-8337-4bd0-95d0-119c1c5ba020")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] 220 ObjectExtensions.cs using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; using System.Xml; namespace System { public static class ObjectExtensions { /// /// Create Duplicate /// /// <typeparam name="T"></typeparam> /// /// <returns></returns> 221 public static T Clone<T>(this T item) { using (MemoryStream ms = new MemoryStream()) { DataContractSerializer ser = new DataContractSerializer(typeof(T)); ser.WriteObject(ms, item); ms.Position = 0; using (XmlReader reader = XmlReader.Create(ms)) { return (T)ser.ReadObject(reader, true); } } } } } SelectionItemExtensions.cs using CarbonEmissio.Models; using System; using System.Collections.Generic; using System.Linq; 222 using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.Extensions { public static class SelectionItemExtensions { public static void Add(this ICollection<SelectionItem> items,string key,string value) { if(items.ContainsKey(key)) { throw new InvalidOperationException("key has exits"); } items.Add(new SelectionItem { Key = key, Value = value }); } public static bool ContainsKey(this IEnumerable<SelectionItem> 223 items,string key) { return items.FirstOrDefault(item => item.Key == key)!=null; } } } ClimateZonesHelpers.cs using CarbonEmissio.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.Helpers { public class ClimateZonesHelper { public static IEnumerable<SelectionItem> SeedData => new List<SelectionItem> { 224 new SelectionItem("1","Climate Zones 1"), new SelectionItem("2","Climate Zones 2"), new SelectionItem("3","Climate Zones 3"), new SelectionItem("4","Climate Zones 4"), new SelectionItem("5","Climate Zones 5"), new SelectionItem("6","Climate Zones 6"), new SelectionItem("7","Climate Zones 7"), new SelectionItem("8","Climate Zones 8") }; } } DataStream.cs using Newtonsoft.Json; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.Helpers 225 { public class DataStream<T> { public DataStream(string dataPath) { _dataPath=dataPath; } private string _dataPath; /// /// read datas /// /// <returns></returns> public IEnumerable<T> Read() { IEnumerable<T> models = new List<T>(); if (!File.Exists(_dataPath)) { if (!Directory.Exists(Path.GetDirectoryName(_dataPath))) { 226 Directory.CreateDirectory(Path.GetDirectoryName(_dataPath)); } string json = JsonConvert.SerializeObject(models); File.WriteAllText(_dataPath, json); return models; } string data = File.ReadAllText(_dataPath); return JsonConvert.DeserializeObject<IEnumerable<T>>(data); } /// /// write datas /// /// /// <returns></returns> public bool Write(IEnumerable<T> models) { string json = JsonConvert.SerializeObject(models); File.WriteAllText(_dataPath, json); return true; } 227 } } MaterialHelper.cs using Autodesk.Revit.DB; using CarbonEmissio.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.Helpers { public class MaterialHelper { public static IEnumerable<CarbonEmissionItem> ReadWallMaterials(Document document, IEnumerable<UnitCarbonEmissionModel> units) { List<CarbonEmissionItem> items = new List<CarbonEmissionItem>(); 228 FilteredElementCollector wallCollector = new FilteredElementCollector(document); var walls = wallCollector.OfClass(typeof(Wall)).Cast<Wall>(); foreach (var wall in walls) { items.AddRange(ReadElementMaterals(wall, units, "Wall")); } return items; } public static IEnumerable<CarbonEmissionItem> ReadFloorMaterials(Document document, IEnumerable<UnitCarbonEmissionModel> units) { List<CarbonEmissionItem> items = new List<CarbonEmissionItem>(); FilteredElementCollector floorCollector = new FilteredElementCollector(document); 229 var floors = floorCollector.OfClass(typeof(Floor)).Cast<Floor>(); foreach (var floor in floors) { items.AddRange(ReadElementMaterals(floor, units, "Floor")); } return items; } public static IEnumerable<CarbonEmissionItem> ReadRoofMaterials(Document document, IEnumerable<UnitCarbonEmissionModel> units) { List<CarbonEmissionItem> items = new List<CarbonEmissionItem>(); FilteredElementCollector roofCollector = new FilteredElementCollector(document); var roofs = roofCollector.OfClass(typeof(RoofBase)).Cast<RoofBase>(); 230 foreach (var roof in roofs) { items.AddRange(ReadElementMaterals(roof, units, "Roof")); } return items; } public static IEnumerable<CarbonEmissionItem> ReadFramingMaterials(Document document, IEnumerable<UnitCarbonEmissionModel> units) { List<CarbonEmissionItem> items = new List<CarbonEmissionItem>(); FilteredElementCollector framingCollector = new FilteredElementCollector(document); var framings = framingCollector.OfClass(typeof(FamilyInstance)).OfCategory(BuiltInCategory.OST _StructuralFraming).Cast<FamilyInstance>(); foreach (var framing in framings) 231 { items.AddRange(ReadElementMaterals(framing, units, "Framing")); } return items; } public static IEnumerable<CarbonEmissionItem> ReadColumnsMaterials(Document document, IEnumerable<UnitCarbonEmissionModel> units) { List<CarbonEmissionItem> items = new List<CarbonEmissionItem>(); FilteredElementCollector framingCollector = new FilteredElementCollector(document); var framings = framingCollector.OfClass(typeof(FamilyInstance)).OfCategory(BuiltInCategory.OST _StructuralColumns).Cast<FamilyInstance>(); foreach (var framing in framings) 232 { items.AddRange(ReadElementMaterals(framing, units, "Columns")); } return items; } private static IEnumerable<CarbonEmissionItem> ReadElementMaterals(Element element, IEnumerable<UnitCarbonEmissionModel> units, string typeName) { Document document = element.Document; List<CarbonEmissionItem> items = new List<CarbonEmissionItem>(); var materialIds = element.GetMaterialIds(false).ToList(); for (int i = 0; i < materialIds.Count; i++) { CarbonEmissionItem item = new CarbonEmissionItem(); item.TypeName = typeName; ElementType roofType = document.GetElement(element.GetTypeId()) as ElementType; 233 item.FamilyName = roofType.FamilyName; item.SymbolName = roofType.Name; bool custom = false; double cO2eMass = 0; var materialId = materialIds[i]; Material material = document.GetElement(materialId) as Material; item.MaterialName = material.Name; SelectionItem co2eUnit = new SelectionItem(); var unitCo2e = units.FirstOrDefault(x => x.MaterialDefinition.Name == item.MaterialName); if (unitCo2e == null) { custom = true; unitCo2e = units.FirstOrDefault(x => x.MaterialDefinition.Name == "UnKnown"); co2eUnit = UnitHelper.GetUnits(SpecTypeId.Volume.TypeId).FirstOrDefault(); } else { cO2eMass = unitCo2e.Value; 234 } item.Model = unitCo2e; item.IsCustom = custom; item.UnitValue = cO2eMass; item.Volume = element.GetMaterialVolume(materialId); var volumeParameter = element.get_Parameter(BuiltInParameter.HOST_VOLUME_COMPUTED); if (volumeParameter != null) { ForgeTypeId unitTypeId = volumeParameter.GetUnitTypeId(); ForgeTypeId symbolId = FormatOptions.GetValidSymbols(unitTypeId).FirstOrDefault(x => !string.IsNullOrEmpty(x.TypeId)); string name = LabelUtils.GetLabelForSymbol(symbolId); item.VolumeUnit = new SelectionItem(unitTypeId.TypeId, name); } items.Add(item); } return items; 235 } } } TreeSpreadHelper.cs using CarbonEmissio.Models; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.Helpers { public class TreeSpreadHelper { private static string _dataPath => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocument s), @"datas\TreeSpreads.json"); //private static string _dataPath => 236 Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), @"datas\TreeSpreads.json"); public static DataStream<TreeSpreadItem> Initilize => new DataStream<TreeSpreadItem>(_dataPath); } } UnitCarbonEmissionHelper.cs using CarbonEmissio.Models; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.Helpers 237 { public class UnitCarbonEmissionHelper { private static string _dataPath => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocument s), @"datas\UnitCarbonEmissions.json"); //private static string _dataPath => Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), @"datas\UnitCarbonEmissions.json"); public static DataStream<UnitCarbonEmissionModel> Initilize=>new DataStream<UnitCarbonEmissionModel>(_dataPath); } } UnitHelper.cs using Autodesk.Revit.DB; using CarbonEmissio.Extensions; using CarbonEmissio.Models; using System; using System.Collections.Generic; using System.Linq; 238 using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.Helpers { public class UnitHelper { public static ForgeTypeId Pressuredrop = SpecTypeId.Stress; public static IEnumerable<ForgeTypeId> SpecTypeIds => new List<ForgeTypeId> { SpecTypeId.Length, SpecTypeId.Area, SpecTypeId.Volume, SpecTypeId.Mass }; public static List<SelectionItem> GetTypes() { List<SelectionItem> types = new List<SelectionItem>(); foreach (ForgeTypeId spec in SpecTypeIds) { 239 string name = LabelUtils.GetLabelForSpec(spec); types.Add(spec.TypeId, name); } return types; } public static List<SelectionItem> GetUnits(string typeId) { ForgeTypeId id=new ForgeTypeId(typeId); List<SelectionItem> units = new List<SelectionItem>(); foreach(var forgeTypeId in UnitUtils.GetValidUnits(id)) { foreach(var symbolId in FormatOptions.GetValidSymbols(forgeTypeId)) { if(string.IsNullOrEmpty(symbolId.TypeId)) { continue; } if (units.ContainsKey(forgeTypeId.TypeId)) { continue; 240 } string name = LabelUtils.GetLabelForSymbol(symbolId); units.Add(forgeTypeId.TypeId, name); } } return units; } } } BaseCommand.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Input; namespace CarbonEmissio.Models { public class BaseCommand : ICommand { 241 public event EventHandler CanExecuteChanged { add { if (_canExecute != null) { CommandManager.RequerySuggested += value; } } remove { if (_canExecute != null) { CommandManager.RequerySuggested -= value; } } } public bool CanExecute(object parameter) { if (_canExecute == null) { 242 return true; } return _canExecute(); } public void Execute(object parameter) { if (_execute != null && CanExecute(parameter)) { _execute(); } } private Func<bool> _canExecute; private Action _execute; public BaseCommand(Action execute, Func<bool> canExecute) { _execute = execute; _canExecute = canExecute; } 243 public BaseCommand(Action execute) : this(execute, null) { } } public class BaseCommand<T> : ICommand { public event EventHandler CanExecuteChanged { add { if (_canExecute != null) { CommandManager.RequerySuggested += value; } } remove { if (_canExecute != null) { CommandManager.RequerySuggested -= value; } 244 } } public bool CanExecute(object parameter) { if (_canExecute == null) { return true; } return _canExecute((T)parameter); } public void Execute(object parameter) { if (_execute != null && CanExecute(parameter)) { _execute((T)parameter); } } private Func<T, bool> _canExecute; private Action<T> _execute; 245 public BaseCommand(Action<T> execute, Func<T, bool> canExecute) { _execute = execute; _canExecute = canExecute; } public BaseCommand(Action<T> execute) : this(execute, null) { } } } CarbonEmissionItem.cs using CarbonEmissio.Helpers; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; 246 namespace CarbonEmissio.Models { public class CarbonEmissionItem : DataBindableBase { private string typeName; private string familyName; private string symbolName; private string materialName; private double volume; private SelectionItem volumeUnit=new SelectionItem(); private bool isCustom; private double unitValue; private UnitCarbonEmissionModel model; private double cO2eMass; private SelectionItem co2eUnit=new SelectionItem(); public string Id { get; set; } = Guid.NewGuid().ToString("N"); public string TypeName { get => typeName; set { typeName = value; RaisePropertyChanged(); } } public string FamilyName { get => familyName; set { familyName = value; RaisePropertyChanged(); } } 247 public string SymbolName { get => symbolName; set { symbolName = value; RaisePropertyChanged(); } } public string MaterialName { get => materialName; set { materialName = value; RaisePropertyChanged(); } } public double Volume { get => volume; set { volume = Math.Round(value, 2); RaisePropertyChanged(); 248 } } public SelectionItem VolumeUnit { get => volumeUnit; set { volumeUnit = value; RaisePropertyChanged(); } } public bool IsCustom { get => isCustom; set { isCustom = value; RaisePropertyChanged(); } } public double UnitValue { get => unitValue; set { 249 unitValue = value; RaisePropertyChanged(); } } public UnitCarbonEmissionModel Model { get => model; set { model = value; RaisePropertyChanged(); if(value!=null) { UnitValue = value.Value; } else { UnitValue = 0; } if(value==null||string.IsNullOrEmpty(value.Id)) { 250 IsCustom = true; } else { IsCustom = false; } } } public double CO2eMass { get => cO2eMass; set { cO2eMass = Math.Round(value,2); RaisePropertyChanged(); } } public SelectionItem Co2eUnit { get => co2eUnit; set { co2eUnit = value; RaisePropertyChanged(); 251 } } } } DataBindableBase.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.Models { /// /// two-way binding /// public class DataBindableBase : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; 252 protected virtual bool SetProperty<T>(ref T storage, T value, [CallerMemberName] string propertyName = null) { if (EqualityComparer<T>.Default.Equals(storage, value)) { return false; } storage = value; RaisePropertyChanged(propertyName); return true; } protected virtual bool SetProperty<T>(ref T storage, T value, Action onChanged, [CallerMemberName] string propertyName = null) { if (EqualityComparer<T>.Default.Equals(storage, value)) { return false; } 253 storage = value; onChanged?.Invoke(); RaisePropertyChanged(propertyName); return true; } protected void RaisePropertyChanged([CallerMemberName] string propertyName = null) { OnPropertyChanged(new PropertyChangedEventArgs(propertyName)); } protected virtual void OnPropertyChanged(PropertyChangedEventArgs args) { this.PropertyChanged?.Invoke(this, args); } } } 254 MaterialDefinition.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.Models { public class MaterialDefinition : DataBindableBase { private double? min; private double? max; private SelectionItem unit = new SelectionItem(); private string group; private string name; private bool silde; public double? Min { get => min; set { min = value; RaisePropertyChanged(); ChangedName(); } } public double? Max { get => max; set { max = value; RaisePropertyChanged(); ChangedName(); } } 255 public SelectionItem Unit { get => unit; set { unit = value; RaisePropertyChanged(); ChangedName(); } } public string Group { get => group; set { group = value; RaisePropertyChanged(); } } public string Name { get => name; set { name = value; RaisePropertyChanged(); } } public bool Silde { get => silde; set { silde = value; RaisePropertyChanged(); } } private void ChangedName() { if(Silde) { if ((Min == null && Max == null) || Unit == null) { Name = string.Empty; } else if (Min == null) { Name = $">{Max} {Unit.Value}"; } else if (Max == null) 256 { Name = $"<{Min} {Unit.Value}"; } else { Name = $"{Min}-{Max} {Unit.Value}"; } } } } } SelectionItem.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.Models { public class SelectionItem : DataBindableBase 257 { public SelectionItem() { } public SelectionItem(string key, string value) { Key = key; Value = value; } private string key; private string val; public string Key { get => key; set { key = value; RaisePropertyChanged(); } } public string Value { get => val; set { val = value; RaisePropertyChanged(); } } } public class SelectionItem<T> : DataBindableBase 258 { public SelectionItem() { } public SelectionItem(string key, T value) { Key = key; Value = value; } private string key; private T val; public string Key { get => key; set { key = value; RaisePropertyChanged(); } } public T Value { get => val; set { val = value; RaisePropertyChanged(); } } } } TreeSpreadDTO.cs 259 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.Models { public class TreeSpreadDTO:DataBindableBase { private TreeSpreadItem _treeSpreadItem = new TreeSpreadItem(); public TreeSpreadItem TreeSpread { get { return _treeSpreadItem; } set { _treeSpreadItem = value; RaisePropertyChanged(); CO2eTotal = TreeCount * (TreeSpread == null ? 0 : TreeSpread.CO2eUnitYear); } } private int _treeCount; 260 public int TreeCount { get { return _treeCount; } set { _treeCount = value; RaisePropertyChanged(); CO2eTotal = TreeCount * (TreeSpread==null?0:TreeSpread.CO2eUnitYear); } } private double _cO2eTotal; public double CO2eTotal { get { return _cO2eTotal; } set { _cO2eTotal = value; RaisePropertyChanged(); } } } } TreeSpreadItem.cs using System; using System.Collections.Generic; using System.Linq; 261 using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.Models { public class TreeSpreadItem : DataBindableBase { private SelectionItem climateZoom=new SelectionItem(); private string treeType; private double cO2eUnitDay; private double cO2eUnitYear; private SelectionItem unit=new SelectionItem(); public SelectionItem ClimateZoom { get => climateZoom; set { climateZoom = value; RaisePropertyChanged(); } } public string TreeType { get => treeType; set { treeType = value; RaisePropertyChanged(); } } public double CO2eUnitDay { get => cO2eUnitDay; set { cO2eUnitDay = value; RaisePropertyChanged(); } } public double CO2eUnitYear { get => cO2eUnitYear; set { 262 cO2eUnitYear = value; RaisePropertyChanged(); } } public SelectionItem Unit { get => unit; set { unit = value; RaisePropertyChanged(); } } } } UnitCarbonEmissionModel.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.Models { public class UnitCarbonEmissionModel : DataBindableBase { public string Id { get; set; } 263 private MaterialDefinition materialDefinition; private double val; private SelectionItem unit=new SelectionItem(); private SelectionItem type=new SelectionItem(); public MaterialDefinition MaterialDefinition { get => materialDefinition; set { materialDefinition = value; RaisePropertyChanged(); } } public double Value { get => val; set { val = value; RaisePropertyChanged(); } } public SelectionItem Unit { get => unit; set { unit = value; RaisePropertyChanged(); } } public SelectionItem Type { get => type; set { type = value; RaisePropertyChanged(); } } } } CarbonEmissionViewModel.cs using Autodesk.Revit.DB; using CarbonEmissio.Helpers; using CarbonEmissio.Models; using CarbonEmissio.Views; 264 using HandyControl.Controls; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; namespace CarbonEmissio.ViewModels { public class CarbonEmissionViewModel:ViewModelBase { public CarbonEmissionViewModel(Document document) { Document = document; } public Document Document { get; } #region View Datas 265 private ObservableCollection<CarbonEmissionItem> _items; public ObservableCollection<CarbonEmissionItem> Items { get { return _items; } set { _items = value; RaisePropertyChanged(); } } private ObservableCollection<UnitCarbonEmissionModel> _unitCes; public ObservableCollection<UnitCarbonEmissionModel> UnitCes { get { return _unitCes; } set { _unitCes = value; RaisePropertyChanged(); } } private SelectionItem _resultUnit; public SelectionItem ResultUnit { get { return _resultUnit; } set { _resultUnit = value; RaisePropertyChanged(); } 266 } private bool _isLoading=true; public bool IsLoading { get { return _isLoading; } set { _isLoading = value; RaisePropertyChanged(); } } private double _total = 0; public double Total { get { return _total; } set { _total = value; RaisePropertyChanged(); } } private bool _calculateCompleted; public bool CalculateCompleted { 267 get { return _calculateCompleted; } set { _calculateCompleted = value; RaisePropertyChanged(); } } #endregion #region View Methods public override void Loaded() { base.Loaded(); IsLoading = true; LoadSheets(); LoadMaterials(); IsLoading = false; } private void LoadSheets() { var items = new List<UnitCarbonEmissionModel>(); 268 items.Add(new UnitCarbonEmissionModel { MaterialDefinition = new MaterialDefinition { Name = "UnKnown" } }); items.AddRange(UnitCarbonEmissionHelper.Initilize.Read().Where(x => x.Type.Key == SpecTypeId.Volume.TypeId)); UnitCes = new ObservableCollection<UnitCarbonEmissionModel>(items); ICollectionView vw = CollectionViewSource.GetDefaultView(UnitCes); vw.GroupDescriptions.Add(new PropertyGroupDescription("MaterialDefinition.Group")); } private void LoadMaterials() { var items = new List<CarbonEmissionItem>(); items.AddRange(MaterialHelper.ReadWallMaterials(Document, UnitCes)); 269 items.AddRange(MaterialHelper.ReadFloorMaterials(Document, UnitCes)); items.AddRange(MaterialHelper.ReadRoofMaterials(Document, UnitCes)); items.AddRange(MaterialHelper.ReadFramingMaterials(Document, UnitCes)); items.AddRange(MaterialHelper.ReadColumnsMaterials(Document, UnitCes)); Items = new ObservableCollection<CarbonEmissionItem>(items); ICollectionView vw = CollectionViewSource.GetDefaultView(Items); vw.GroupDescriptions.Add(new PropertyGroupDescription("TypeName")); } public BaseCommand OpenUnitSheet => new BaseCommand(() => { UnitCarbonEmissionViewModel vm = new UnitCarbonEmissionViewModel(); UnitCarbonEmissionView view = new UnitCarbonEmissionView(vm); view.ShowDialog(); LoadSheets(); 270 LoadMaterials(); }); public BaseCommand OpenTreeSheet => new BaseCommand(() => { TreeSpreadViewModel vm = new TreeSpreadViewModel(); TreeSpreadView view=new TreeSpreadView(vm); view.ShowDialog(); }); public BaseCommand<ComboBox> UnitCesLoaded => new BaseCommand<ComboBox>((control) => { if (control != null) { if(control.ItemsSource != null) { var item=control.DataContext as CarbonEmissionItem; if(item != null&&item.Model!=null) { control.SelectedItem = UnitCes.FirstOrDefault(x => x.Id == item.Model.Id); 271 } else { control.SelectedItem = UnitCes.FirstOrDefault(x => x.MaterialDefinition.Name == "UnKnown"); } } } }); public BaseCommand<ComboBox> UnitCesChanged => new BaseCommand<ComboBox>((control) => { if(control!=null) { if(control.SelectedItem != null) { var item=Items.FirstOrDefault(x => x.Id == (control.DataContext as CarbonEmissionItem).Id); if(item!=null) { item.Model = control.SelectedItem as 272 UnitCarbonEmissionModel; } } else { control.SelectedItem = UnitCes.FirstOrDefault(x => x.MaterialDefinition.Name == "UnKnown"); } } }); public BaseCommand Calculate => new BaseCommand(() => { Total = 0; foreach(var item in Items) { if(item.IsCustom) { item.CO2eMass = item.UnitValue * item.Volume; } else { 273 item.CO2eMass = UnitUtils.Convert(item.Model.Value, new ForgeTypeId(item.Model.Unit.Key), new ForgeTypeId(item.VolumeUnit.Key))*item.Volume; } Total+=item.CO2eMass; } CalculateCompleted = true; }); public BaseCommand Next => new BaseCommand(() => { PriceCalculateViewModel vm=new PriceCalculateViewModel(Total); PriceCalculateView view=new PriceCalculateView(vm); view.ShowDialog(); }); #endregion } } PriceCalculateViewModel.cs using Autodesk.Revit.DB; 274 using CarbonEmissio.Extensions; using CarbonEmissio.Helpers; using CarbonEmissio.Models; using CarbonEmissio.Views; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace CarbonEmissio.ViewModels { public class PriceCalculateViewModel:ViewModelBase { public PriceCalculateViewModel(double buildingCO2e) { BuildingCO2e = buildingCO2e; } #region View Datas 275 private double _buildingCO2e = 0; public double BuildingCO2e { get { return _buildingCO2e; } set { _buildingCO2e = value; RaisePropertyChanged(); PriceCalculate(); } } private ObservableCollection<TreeSpreadDTO> _treeSpreads=new ObservableCollection<TreeSpreadDTO>(); public ObservableCollection<TreeSpreadDTO> TreeSpreads { get { return _treeSpreads; } set { _treeSpreads = value; RaisePropertyChanged(); } } private TreeSpreadDTO _selectedItem; public TreeSpreadDTO SelectedItem 276 { get { return _selectedItem; } set { _selectedItem = value; RaisePropertyChanged(); } } private double _treeSpreadTotal = 0; public double TreeSpreadTotal { get { return _treeSpreadTotal; } set { _treeSpreadTotal = value; RaisePropertyChanged(); } } private double _surplus=0; public double Surplus { get { return _surplus; } set { _surplus = value; RaisePropertyChanged(); } } 277 private double _unitPrice=0; public double UnitPrice { get { return _unitPrice; } set { _unitPrice = value; RaisePropertyChanged(); PriceCalculate(); } } private double _totalPrice = 0; public double TotalPrice { get { return _totalPrice; } set { _totalPrice = value; RaisePropertyChanged(); } } #endregion #region View Methods 278 private void OrderTreeSpreadItems() { TreeSpreads = new ObservableCollection<TreeSpreadDTO>(TreeSpreads.OrderBy(x => x.TreeSpread.ClimateZoom.Key)); } public BaseCommand AddTree => new BaseCommand(() => { TreeDtoEditViewModel vm = new TreeDtoEditViewModel(); TreeDtoEditView view = new TreeDtoEditView(vm); var result = view.ShowDialog(); if (result != null && (bool)result) { TreeSpreads.Add(vm.TreeSpread); OrderTreeSpreadItems(); PriceCalculate(); } }); public BaseCommand EditTree => new BaseCommand(() => { 279 if (SelectedItem != null) { TreeDtoEditViewModel vm = new TreeDtoEditViewModel(SelectedItem.Clone()); TreeDtoEditView view = new TreeDtoEditView(vm); var result = view.ShowDialog(); if (result != null && (bool)result) { TreeSpreads.Remove(SelectedItem); TreeSpreads.Add(vm.TreeSpread); OrderTreeSpreadItems(); PriceCalculate(); } } }); public BaseCommand DeleteTree => new BaseCommand(() => { if (SelectedItem != null) { if (MessageBox.Show("Are you sure to delete?", String.Empty, MessageBoxButton.YesNo) == MessageBoxResult.Yes) 280 { TreeSpreads.Remove(SelectedItem); OrderTreeSpreadItems(); PriceCalculate(); } } }); private void PriceCalculate() { double treeCO2e = 0; string kgUnit = UnitHelper.GetUnits(SpecTypeId.Mass.TypeId).FirstOrDefault(x => x.Value == "kg")?.Key; foreach (var treeSpread in TreeSpreads) { treeCO2e += UnitUtils.Convert(treeSpread.CO2eTotal,new ForgeTypeId(treeSpread.TreeSpread.Unit.Key),new ForgeTypeId(kgUnit)); } TreeSpreadTotal = treeCO2e; Surplus = BuildingCO2e - TreeSpreadTotal; TotalPrice = Surplus * UnitPrice; 281 } #endregion } } TreeDtoEditViewModel.cs using CarbonEmissio.Helpers; using CarbonEmissio.Models; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; namespace CarbonEmissio.ViewModels { public class TreeDtoEditViewModel:ViewModelBase { 282 public TreeDtoEditViewModel() { TreeSpread=new TreeSpreadDTO(); } public TreeDtoEditViewModel(TreeSpreadDTO treeSpread) { TreeSpread=treeSpread; } #region View Datas private ObservableCollection<SelectionItem<TreeSpreadItem>> _items=new ObservableCollection<SelectionItem<TreeSpreadItem>>(); public ObservableCollection<SelectionItem<TreeSpreadItem>> Items { get { return _items; } set { _items = value; RaisePropertyChanged(); } } private string _selectedTree; 283 public string SelectedTree { get { return _selectedTree; } set { _selectedTree = value; RaisePropertyChanged(); if(string.IsNullOrEmpty(value)) { UnitCO2e = 0; } else { UnitCO2e = Items.FirstOrDefault(x => x.Key == value).Value.CO2eUnitYear; } } } private double _unitCO2e=0; public double UnitCO2e { get { return _unitCO2e; } 284 set { _unitCO2e = value; RaisePropertyChanged(); } } private TreeSpreadDTO _treeSpread; public TreeSpreadDTO TreeSpread { get { return _treeSpread; } set { _treeSpread = value; RaisePropertyChanged(); } } #endregion #region View Methods public override void Loaded() { base.Loaded(); 285 var items=TreeSpreadHelper.Initilize.Read().Select(x => new SelectionItem<TreeSpreadItem>(Guid.NewGuid().ToString(), x)).ToList(); Items = new ObservableCollection<SelectionItem<TreeSpreadItem>>(items.OrderBy(x=>x.Value. ClimateZoom.Value)); ICollectionView vw = CollectionViewSource.GetDefaultView(Items); vw.GroupDescriptions.Add(new PropertyGroupDescription("Value.ClimateZoom.Value")); SelectedTree = Items.FirstOrDefault(x => x.Value.ClimateZoom.Key == TreeSpread.TreeSpread?.ClimateZoom?.Key && x.Value.TreeType == TreeSpread.TreeSpread?.TreeType)?.Key; } public BaseCommand Accept => new BaseCommand(() => { if(string.IsNullOrEmpty(SelectedTree)) { return; } TreeSpread.TreeSpread= Items.FirstOrDefault(x => x.Key == 286 SelectedTree)?.Value; if(TreeSpread.TreeSpread == null) { return; } AcceptCommand.Execute(null); }); #endregion } } TreeSpreadEditViewModel.cs using Autodesk.Revit.DB; using CarbonEmissio.Helpers; using CarbonEmissio.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; 287 using System.Threading.Tasks; namespace CarbonEmissio.ViewModels { public class TreeSpreadEditViewModel:ViewModelBase { public TreeSpreadEditViewModel(TreeSpreadItem model) { Model = model; Initilized(); } public TreeSpreadEditViewModel() { Model=new TreeSpreadItem(); Initilized(); } #region View Data private TreeSpreadItem _model; 288 public TreeSpreadItem Model { get { return _model; } set { _model = value; RaisePropertyChanged(); } } private IEnumerable<SelectionItem> _climateZones; public IEnumerable<SelectionItem> ClimateZones { get { return _climateZones; } set { _climateZones = value; RaisePropertyChanged(); } } private IEnumerable<SelectionItem> _unitTypes; public IEnumerable<SelectionItem> UnitTypes { get { return _unitTypes; } set { _unitTypes = value; RaisePropertyChanged(); } } 289 #endregion #region View Method public void Initilized() { ClimateZones = ClimateZonesHelper.SeedData; UnitTypes=UnitHelper.GetUnits(SpecTypeId.Mass.TypeId); } public override void Loaded() { base.Loaded(); } public BaseCommand Accept => new BaseCommand(() => { if (string.IsNullOrEmpty(Model.Unit.Key)) { return; 290 } if(string.IsNullOrEmpty(Model.TreeType)) { return; } if(string.IsNullOrEmpty(Model.ClimateZoom.Key)) { return; } Model.ClimateZoom.Value = ClimateZones.FirstOrDefault(x => x.Key == Model.ClimateZoom.Key).Value; Model.Unit.Value = UnitTypes.FirstOrDefault(x => x.Key == Model.Unit.Key).Value; AcceptCommand.Execute(null); }); #endregion } 291 } TreeSpreadViewModel.cs using CarbonEmissio.Extensions; using CarbonEmissio.Helpers; using CarbonEmissio.Models; using CarbonEmissio.Views; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Data; namespace CarbonEmissio.ViewModels { public class TreeSpreadViewModel: ViewModelBase { #region View Data 292 private ObservableCollection<TreeSpreadItem> _items; public ObservableCollection<TreeSpreadItem> Items { get { return _items; } set { _items = value; RaisePropertyChanged(); } } private TreeSpreadItem _selectedItem; public TreeSpreadItem SelectedItem { get { return _selectedItem; } set { _selectedItem = value; RaisePropertyChanged(); } } #endregion #region View Method 293 public override void Loaded() { base.Loaded(); LoadDatas(); } private void LoadDatas() { var items = TreeSpreadHelper.Initilize.Read().OrderBy(x=>x.ClimateZoom.Key); Items = new ObservableCollection<TreeSpreadItem>(items); ICollectionView vw = CollectionViewSource.GetDefaultView(Items); vw.GroupDescriptions.Add(new PropertyGroupDescription("ClimateZoom.Value")); } public BaseCommand AddData => new BaseCommand(() => { TreeSpreadEditViewModel vm = new TreeSpreadEditViewModel(); TreeSpreadEditView view = new TreeSpreadEditView(vm); var result = view.ShowDialog(); if (result != null && (bool)result) 294 { Items.Add(vm.Model); TreeSpreadHelper.Initilize.Write(Items); LoadDatas(); } }); public BaseCommand EditData => new BaseCommand(() => { if(SelectedItem!=null) { TreeSpreadEditViewModel vm = new TreeSpreadEditViewModel(SelectedItem.Clone()); TreeSpreadEditView view = new TreeSpreadEditView(vm); var result = view.ShowDialog(); if(result!=null&&(bool)result) { Items.Remove(SelectedItem); Items.Add(vm.Model); TreeSpreadHelper.Initilize.Write(Items); LoadDatas(); 295 } } }); public BaseCommand DeleteData => new BaseCommand(() => { if (SelectedItem != null) { if (MessageBox.Show("Are you sure to delete?", String.Empty, MessageBoxButton.YesNo) == System.Windows.MessageBoxResult.Yes) { Items.Remove(SelectedItem); TreeSpreadHelper.Initilize.Write(Items); LoadDatas(); } } }); #endregion } } 296 UnitCarbonEmissionEditViewModel.cs using CarbonEmissio.Extensions; using CarbonEmissio.Helpers; using CarbonEmissio.Models; using HandyControl.Controls; using HandyControl.Tools; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.ViewModels { public class UnitCarbonEmissionEditViewModel:ViewModelBase { public UnitCarbonEmissionEditViewModel(bool isSlide,IEnumerable<string> groups) { IsSlide = isSlide; Groups = groups; 297 Initilized(); } public UnitCarbonEmissionEditViewModel(UnitCarbonEmissionModel model, IEnumerable<string> groups) { Model = model; Groups = groups; IsSlide = model.MaterialDefinition.Unit != null&& !string.IsNullOrEmpty(model.MaterialDefinition.Unit.Key); Initilized(); } private void Initilized() { PressuredropUnits = UnitHelper.GetUnits(UnitHelper.Pressuredrop.TypeId); ValueTypes = UnitHelper.GetTypes(); } 298 #region View Data public IEnumerable<string> Groups { get; set; } private bool _isSlide; public bool IsSlide { get { return _isSlide; } set { _isSlide = value; RaisePropertyChanged(); } } private UnitCarbonEmissionModel _model; public UnitCarbonEmissionModel Model { get { return _model; } set { _model = value; RaisePropertyChanged(); } } private List<SelectionItem> _pressuredropUnits; 299 public List<SelectionItem> PressuredropUnits { get { return _pressuredropUnits; } set { _pressuredropUnits = value; RaisePropertyChanged(); } } private List<SelectionItem> _valueTypes; public List<SelectionItem> ValueTypes { get { return _valueTypes; } set { _valueTypes = value; RaisePropertyChanged(); } } private List<SelectionItem> _valueUnits; public List<SelectionItem> ValueUnits { get { return _valueUnits; } set { _valueUnits = value; RaisePropertyChanged(); } } 300 #endregion #region View Method public override void Loaded() { base.Loaded(); if(Model==null) { Model = new UnitCarbonEmissionModel { Id = Guid.NewGuid().ToString("N"), MaterialDefinition = new MaterialDefinition() { Silde = IsSlide } }; } else 301 { ValueUnits = UnitHelper.GetUnits(Model.Type.Key); } } public BaseCommand<string> TypeChanged => new BaseCommand<string>((typeId) => { ValueUnits=UnitHelper.GetUnits(typeId); }); public BaseCommand Accept => new BaseCommand(() => { if(Model==null) { return ; } if (IsSlide) { if (Model.MaterialDefinition.Unit == null) { 302 return; } if(string.IsNullOrEmpty(Model.MaterialDefinition.Unit.Key)) { return; } } if(Model.Type==null) { return; } if(string.IsNullOrEmpty(Model.Type.Key)) { return; } if (Model.Unit == null) { return; 303 } if(string.IsNullOrEmpty(Model.Unit.Key)) { return; } if (string.IsNullOrWhiteSpace(Model.MaterialDefinition.Group)) { return; } if (string.IsNullOrWhiteSpace(Model.MaterialDefinition.Name)) { return; } if(!ValidateHelper.IsInRangeOfPosDouble(Model.Value)) { return; } 304 if(IsSlide) { Model.MaterialDefinition.Unit.Value = PressuredropUnits.FirstOrDefault(x => x.Key == Model.MaterialDefinition.Unit.Key).Value; } Model.Type.Value = ValueTypes.FirstOrDefault(x => x.Key == Model.Type.Key).Value; Model.Unit.Value = ValueUnits.FirstOrDefault(x => x.Key == Model.Unit.Key).Value; AcceptCommand.Execute(null); }); #endregion } } UnitCarbonEmissionViewModel using CarbonEmissio.Extensions; using CarbonEmissio.Helpers; using CarbonEmissio.Models; 305 using CarbonEmissio.Views; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Data; using System.Windows.Media.Converters; namespace CarbonEmissio.ViewModels { public class UnitCarbonEmissionViewModel: ViewModelBase { #region View Data private ObservableCollection<UnitCarbonEmissionModel> _items; public ObservableCollection<UnitCarbonEmissionModel> Items { 306 get { return _items; } set { _items = value; RaisePropertyChanged(); } } private UnitCarbonEmissionModel _selectedItem; public UnitCarbonEmissionModel SelectedItem { get { return _selectedItem; } set { _selectedItem = value; RaisePropertyChanged(); CanEdit = value != null; } } private bool _canEdit; public bool CanEdit { get { return _canEdit; } set { _canEdit = value; RaisePropertyChanged(); } } 307 #endregion #region View Method public override void Loaded() { base.Loaded(); LoadDatas(); } private void LoadDatas() { var items = UnitCarbonEmissionHelper.Initilize.Read(); Items = new ObservableCollection<UnitCarbonEmissionModel>(items); ICollectionView vw = CollectionViewSource.GetDefaultView(Items); vw.GroupDescriptions.Add(new PropertyGroupDescription("MaterialDefinition.Group")); } public BaseCommand AddSlidData => new BaseCommand(() => 308 { UnitCarbonEmissionEditViewModel vm = new UnitCarbonEmissionEditViewModel(true, Items.GroupBy(x => x.MaterialDefinition.Group).Select(x => x.Key)); if (SelectedItem != null) { var model = SelectedItem.Clone(); model.Id = Guid.NewGuid().ToString("N"); vm = new UnitCarbonEmissionEditViewModel(model, Items.GroupBy(x => x.MaterialDefinition.Group).Select(x => x.Key)); } UnitCarbonEmissionEditView view = new UnitCarbonEmissionEditView(vm); var result = view.ShowDialog(); if (result != null&&(bool)result) { Items.Add(vm.Model); UnitCarbonEmissionHelper.Initilize.Write(Items); } }); public BaseCommand AddFixedData => new BaseCommand(() => 309 { UnitCarbonEmissionEditViewModel vm = new UnitCarbonEmissionEditViewModel(false, Items.GroupBy(x => x.MaterialDefinition.Group).Select(x => x.Key)); if(SelectedItem!=null) { var model = SelectedItem.Clone(); model.Id = Guid.NewGuid().ToString("N"); vm = new UnitCarbonEmissionEditViewModel(model, Items.GroupBy(x => x.MaterialDefinition.Group).Select(x => x.Key)); } UnitCarbonEmissionEditView view = new UnitCarbonEmissionEditView(vm); var result = view.ShowDialog(); if (result != null && (bool)result) { Items.Add(vm.Model); UnitCarbonEmissionHelper.Initilize.Write(Items); } }); public BaseCommand EditData => new BaseCommand(() => 310 { if(SelectedItem!=null) { UnitCarbonEmissionEditViewModel vm = new UnitCarbonEmissionEditViewModel(SelectedItem.Clone(), Items.GroupBy(x => x.MaterialDefinition.Group).Select(x => x.Key)); UnitCarbonEmissionEditView view = new UnitCarbonEmissionEditView(vm); var result = view.ShowDialog(); if (result != null && (bool)result) { Items.Remove(SelectedItem); Items.Add(vm.Model); UnitCarbonEmissionHelper.Initilize.Write(Items); } } }); public BaseCommand DeleteData => new BaseCommand(() => { if(SelectedItem != null) { 311 if(MessageBox.Show("Are you sure to delete?",String.Empty,MessageBoxButton.YesNo)==System.Windows.MessageBoxR esult.Yes) { Items.Remove(SelectedItem); UnitCarbonEmissionHelper.Initilize.Write(Items); } } }); #endregion } } ViewModelBase.cs using CarbonEmissio.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; 312 using System.Windows.Threading; namespace CarbonEmissio.ViewModels { public class ViewModelBase:DataBindableBase { public bool IsCanDrag { get; set; } = true; public BaseCommand CloseCommand { get; set; } public BaseCommand AcceptCommand { get; set; } public BaseCommand CancelCommand { get; set; } public BaseCommand DragWindowCommand { get; set; } public Dispatcher Dispatcher { get; set; } public virtual void Loaded() { } } } CarbonEmissionView.xaml <local:WindowBase x:Class="CarbonEmissio.Views.CarbonEmissionView" 313 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup- compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:CarbonEmissio.Views" xmlns:hc="https://handyorg.github.io/handycontrol" mc:Ignorable="d" WindowStartupLocation="CenterScreen" AllowsTransparency="True" Background="Transparent" WindowStyle="None" BorderBrush="Transparent" Height="550" Width="1200"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" /> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" /> </ResourceDictionary.MergedDictionaries> 314 </ResourceDictionary> </Window.Resources> <Border Background="{DynamicResource BackgroundBrush}" Padding="5" CornerRadius="10" IsEnabled="{Binding IsLoading, Converter={StaticResource Boolean2BooleanReConverter}}" BorderThickness="1" BorderBrush="Black" Effect="{DynamicResource EffectShadow3}"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="40"/> <RowDefinition/> <RowDefinition Height="40"/> <RowDefinition Height="40"/> </Grid.RowDefinitions> <hc:SimplePanel Grid.Row="0"> <hc:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left"> <Image Width="40" Height="30" Source="/CarbonEmissio;component/images/logo.jpg"/> <TextBlock Margin="5" Text="CAT PLUG-IN" VerticalAlignment="Center" FontWeight="Bold" FontSize="14"/> </hc:SimpleStackPanel> 315 <hc:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Right"> </hc:SimpleStackPanel> </hc:SimplePanel> <hc:SimplePanel Grid.Row="1"> <hc:LoadingCircle Panel.ZIndex="999" Visibility="{Binding IsLoading, Converter={StaticResource Boolean2VisibilityConverter}}"/> <DataGrid Margin="5" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" SelectionMode="Single" ItemsSource="{Binding Items}"> <DataGrid.GroupStyle> <GroupStyle> <GroupStyle.ContainerStyle> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GroupItem}"> 316 <Expander IsExpanded="True"> <Expander.Header> <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"/> </Expander.Header> <ItemsPresenter /> </Expander> </ControlTemplate> </Setter.Value> </Setter> </GroupStyle.ContainerStyle> <GroupStyle.Panel> <ItemsPanelTemplate> <DataGridRowsPresenter/> </ItemsPanelTemplate> </GroupStyle.Panel> </GroupStyle> </DataGrid.GroupStyle> <DataGrid.Columns> <DataGridTextColumn Header="Family" Width="*" 317 IsReadOnly="True" Binding="{Binding FamilyName}"/> <DataGridTextColumn Header="Material:Description" Width="*" IsReadOnly="True" Binding="{Binding MaterialName}"/> <DataGridTemplateColumn Header="Material:Result" Width="3*"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <hc:ComboBox ItemsSource="{Binding DataContext.UnitCes, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" DisplayMemberPath="MaterialDefinition.Name" SelectedValuePath="Id"> <hc:ComboBox.GroupStyle> <GroupStyle> <GroupStyle.ContainerStyle> <Setter Property="Template"> <Setter.Value> 318 <ControlTemplate TargetType="{x:Type GroupItem}"> <Expander IsExpanded="True"> <Expander.Header> <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"/> </Expander.Header> <ItemsPresenter /> </Expander> </ControlTemplate> </Setter.Value> </Setter> </GroupStyle.ContainerStyle> 319 <GroupStyle.Panel> <ItemsPanelTemplate> <DataGridRowsPresenter/> </ItemsPanelTemplate> </GroupStyle.Panel> </GroupStyle> </hc:ComboBox.GroupStyle> <hc:Interaction.Triggers> <hc:EventTrigger EventName="SelectionChanged"> <hc:InvokeCommandAction Command="{Binding DataContext.UnitCesChanged, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=hc:ComboBox}}"/> </hc:EventTrigger> <hc:EventTrigger EventName="Loaded"> 320 <hc:InvokeCommandAction Command="{Binding DataContext.UnitCesLoaded, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=hc:ComboBox}}"/> </hc:EventTrigger> </hc:Interaction.Triggers> </hc:ComboBox> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> <DataGridTextColumn Header="Unit Co2e" Width="*" Binding="{Binding UnitValue}" IsReadOnly="True"/> <DataGridTextColumn Header="Type" Width="*" IsReadOnly="True" Binding="{Binding SymbolName}"/> <DataGridTextColumn Header="Volume" Width="2*" IsReadOnly="True" Binding="{Binding Volume}"/> <DataGridTextColumn Header="Volume Unit" Width="*" IsReadOnly="True" Binding="{Binding VolumeUnit.Value}"/> <DataGridTextColumn Header="Co2e" Width="2*" IsReadOnly="True" Binding="{Binding CO2eMass}"/> </DataGrid.Columns> </DataGrid> 321 </hc:SimplePanel> <DockPanel Width="200" HorizontalAlignment="Right" Grid.Row="2"> <TextBlock Text="Total" Margin="5" DockPanel.Dock="Left" VerticalAlignment="Center"/> <TextBox Margin="5" Text="{Binding Total}"/> </DockPanel> <DockPanel HorizontalAlignment="Right" Grid.Row="3"> </DockPanel> </Grid> </Border> </local:WindowBase> 322 PriceCalculateView.xaml <local:WindowBase x:Class="CarbonEmissio.Views.PriceCalculateView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup- compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:CarbonEmissio.Views" xmlns:hc="https://handyorg.github.io/handycontrol" mc:Ignorable="d" WindowStartupLocation="CenterScreen" AllowsTransparency="True" Background="Transparent" WindowStyle="None" BorderBrush="Transparent" Height="490" Width="1100"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" /> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" /> </ResourceDictionary.MergedDictionaries> 323 </ResourceDictionary> </Window.Resources> <Border Background="{DynamicResource BackgroundBrush}" Padding="5" CornerRadius="10" BorderThickness="1" BorderBrush="Black" Effect="{DynamicResource EffectShadow3}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="510"/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid Grid.Column="0"> <Grid.RowDefinitions> <RowDefinition Height="40"/> <RowDefinition/> </Grid.RowDefinitions> <hc:SimpleStackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Left"> <Image Width="40" Height="30" Source="/CarbonEmissio;component/images/logo.jpg"/> <TextBlock Margin="5" Text="CAT PLUG-IN" VerticalAlignment="Center" FontWeight="Bold" FontSize="14"/> 324 </hc:SimpleStackPanel> <hc:SimplePanel Grid.Row="1"> <hc:ImageViewer Margin="5" ImageSource="/CarbonEmissio;component/images/TreeSpread.png" ShowImgMap="True"/> </hc:SimplePanel> </Grid> <Grid Grid.Column="1"> <Grid.RowDefinitions> <RowDefinition Height="10"/> <RowDefinition/> <RowDefinition Height="40"/> </Grid.RowDefinitions> <hc:SimpleStackPanel Grid.Row="1" Orientation="Vertical"> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="Building CO2e (kg)" VerticalAlignment="Center" Margin="5" Width="110"/> <hc:TextBox VerticalAlignment="Center" Margin="5" Text="{Binding BuildingCO2e}" IsReadOnly="True"/> </DockPanel> <hc:Divider Margin="1"/> <Expander IsExpanded="True"> 325 <Expander.Header> <TextBlock Text="Carbon Neutrality" FontWeight="Bold"/> </Expander.Header> <Grid> <Grid.RowDefinitions> <RowDefinition Height="40"/> <RowDefinition Height="200"/> <RowDefinition Height="40"/> </Grid.RowDefinitions> <DockPanel Grid.Row="0" HorizontalAlignment="Left"> </DockPanel> 326 <DataGrid Grid.Row="1" Margin="5" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" SelectionMode="Single" IsReadOnly="True" ItemsSource="{Binding TreeSpreads}" SelectedItem="{Binding SelectedItem}"> <DataGrid.Columns> <DataGridTextColumn Header="Zones Num" Width="*" Binding="{Binding TreeSpread.ClimateZoom.Key}"/> <DataGridTextColumn Header="Tree Types" Width="*" Binding="{Binding TreeSpread.TreeType}"/> <DataGridTextColumn Header="Count" Width="*" Binding="{Binding TreeCount}"/> <DataGridTextColumn Header="Unit" Width="*" Binding="{Binding TreeSpread.Unit.Value}"/> <DataGridTextColumn Header="CO2e" Width="*" Binding="{Binding CO2eTotal}"/> </DataGrid.Columns> </DataGrid> <DockPanel Width="200" HorizontalAlignment="Right" Grid.Row="2"> <TextBlock Text="Total" Margin="5" DockPanel.Dock="Left" VerticalAlignment="Center"/> 327 <TextBox Margin="5" Text="{Binding TreeSpreadTotal}" IsReadOnly="True"/> </DockPanel> </Grid> </Expander> <Expander IsExpanded="True"> <Expander.Header> <TextBlock Text="Carbon Trading" FontWeight="Bold"/> </Expander.Header> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <DockPanel Height="40" Grid.Column="0"> <TextBlock DockPanel.Dock="Left" Text="Surplus (kg)" VerticalAlignment="Center" Margin="5" Width="70"/> <hc:TextBox VerticalAlignment="Center" Margin="5" Text="{Binding Surplus}" IsReadOnly="True"/> </DockPanel> 328 <DockPanel Height="40" Grid.Column="1"> <hc:Divider Orientation="Vertical" DockPanel.Dock="Left"/> <TextBlock DockPanel.Dock="Left" Text="Unit Price" VerticalAlignment="Center" Margin="5" Width="60"/> <hc:TextBox VerticalAlignment="Center" Margin="5" Text="{Binding UnitPrice}"/> </DockPanel> <DockPanel Height="40" Grid.Column="2"> <hc:Divider Orientation="Vertical" DockPanel.Dock="Left"/> <TextBlock DockPanel.Dock="Left" Text="Price" VerticalAlignment="Center" Margin="5" Width="30"/> <hc:TextBox VerticalAlignment="Center" Margin="5" Text="{Binding TotalPrice}" IsReadOnly="True"/> </DockPanel> </Grid> </Expander> </hc:SimpleStackPanel> <DockPanel HorizontalAlignment="Right" Grid.Row="2"> </DockPanel> </Grid> </Grid> </Border> </local:WindowBase> TreeDtoEditView.xaml <local:WindowBase x:Class="CarbonEmissio.Views.TreeDtoEditView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup- compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:CarbonEmissio.Views" xmlns:hc="https://handyorg.github.io/handycontrol" mc:Ignorable="d" WindowStartupLocation="CenterScreen" AllowsTransparency="True" Background="Transparent" WindowStyle="None" BorderBrush="Transparent" d:Height="190" Width="350" SizeToContent="Height"> <Window.Resources> <ResourceDictionary> 330 <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" /> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> <Border Background="{DynamicResource BackgroundBrush}" Padding="10" CornerRadius="10" BorderThickness="1" BorderBrush="Black" Effect="{DynamicResource EffectShadow3}"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="10"/> <RowDefinition Height="auto"/> <RowDefinition Height="40"/> <RowDefinition Height="10"/> </Grid.RowDefinitions> <StackPanel Grid.Row="1" Orientation="Vertical"> <DockPanel Height="40"> 331 <TextBlock DockPanel.Dock="Left" Text="Tree Types" VerticalAlignment="Center" Margin="5" Width="80"/> <hc:ComboBox VerticalAlignment="Center" Margin="5" ItemsSource="{Binding Items}" DisplayMemberPath="Value.TreeType" SelectedValuePath="Key" SelectedValue="{Binding SelectedTree}"> <hc:ComboBox.GroupStyle> <GroupStyle> <GroupStyle.ContainerStyle> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GroupItem}"> <Expander IsExpanded="True"> <Expander.Header> <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"/> </Expander.Header> 332 <ItemsPresenter /> </Expander> </ControlTemplate> </Setter.Value> </Setter> </GroupStyle.ContainerStyle> <GroupStyle.Panel> <ItemsPanelTemplate> <DataGridRowsPresenter/> </ItemsPanelTemplate> </GroupStyle.Panel> </GroupStyle> </hc:ComboBox.GroupStyle> </hc:ComboBox> </DockPanel> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="Unit CO2e" VerticalAlignment="Center" Margin="5" Width="80"/> <hc:TextBox VerticalAlignment="Center" Margin="5" Text="{Binding UnitCO2e}" IsReadOnly="True"/> 333 </DockPanel> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="Tree Count" VerticalAlignment="Center" Margin="5" Width="80"/> <hc:TextBox VerticalAlignment="Center" Margin="5" Text="{Binding TreeSpread.TreeCount}"/> </DockPanel> </StackPanel> <DockPanel HorizontalAlignment="Right" Grid.Row="2"> </DockPanel> </Grid> </Border> </local:WindowBase> TreeSpreadEditView.xaml <local:WindowBase x:Class="CarbonEmissio.Views.TreeSpreadEditView" 334 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup- compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:CarbonEmissio.Views" xmlns:hc="https://handyorg.github.io/handycontrol" mc:Ignorable="d" WindowStartupLocation="CenterScreen" AllowsTransparency="True" Background="Transparent" WindowStyle="None" BorderBrush="Transparent" d:Height="270" Width="350" SizeToContent="Height"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" /> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> 335 <Border Background="{DynamicResource BackgroundBrush}" Padding="10" CornerRadius="10" BorderThickness="1" BorderBrush="Black" Effect="{DynamicResource EffectShadow3}"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="10"/> <RowDefinition Height="auto"/> <RowDefinition Height="40"/> <RowDefinition Height="10"/> </Grid.RowDefinitions> <StackPanel Grid.Row="1" Orientation="Vertical"> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="Climate Zone" VerticalAlignment="Center" Margin="5" Width="80"/> <hc:ComboBox VerticalAlignment="Center" Margin="5" ItemsSource="{Binding ClimateZones}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding Model.ClimateZoom.Key}"/> </DockPanel> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="Tree Types" VerticalAlignment="Center" Margin="5" Width="80"/> 336 <hc:TextBox VerticalAlignment="Center" Margin="5" Text="{Binding Model.TreeType}"/> </DockPanel> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="CO2e PerDay" VerticalAlignment="Center" Margin="5" Width="80"/> <hc:TextBox VerticalAlignment="Center" Margin="5" Text="{Binding Model.CO2eUnitDay}"/> </DockPanel> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="CO2e PerYear" VerticalAlignment="Center" Margin="5" Width="80"/> <hc:TextBox VerticalAlignment="Center" Margin="5" Text="{Binding Model.CO2eUnitYear}"/> </DockPanel> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="Unit" VerticalAlignment="Center" Margin="5" Width="80"/> <hc:ComboBox VerticalAlignment="Center" Margin="5" ItemsSource="{Binding UnitTypes}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding Model.Unit.Key}"/> </DockPanel> 337 </StackPanel> <DockPanel HorizontalAlignment="Right" Grid.Row="2"> </DockPanel> </Grid> </Border> </local:WindowBase> TreeSpreadView.xaml <local:WindowBase x:Class="CarbonEmissio.Views.TreeSpreadView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup- compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:CarbonEmissio.Views" xmlns:hc="https://handyorg.github.io/handycontrol" 338 mc:Ignorable="d" WindowStartupLocation="CenterScreen" AllowsTransparency="True" Background="Transparent" WindowStyle="None" BorderBrush="Transparent" Height="410" Width="1100"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" /> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> <Border Background="{DynamicResource BackgroundBrush}" Padding="5" CornerRadius="10" BorderThickness="1" BorderBrush="Black" Effect="{DynamicResource EffectShadow3}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="560"/> 339 <ColumnDefinition/> </Grid.ColumnDefinitions> <hc:ImageViewer Margin="5" ImageSource="/CarbonEmissio;component/images/TreeSpread.png" ShowImgMap="True"/> <Grid Grid.Column="1"> <Grid.RowDefinitions> <RowDefinition Height="40"/> <RowDefinition/> <RowDefinition Height="40"/> </Grid.RowDefinitions> <DockPanel Grid.Row="0" HorizontalAlignment="Left"> </DockPanel> <hc:SimplePanel Grid.Row="1"> <DataGrid Margin="5" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" SelectionMode="Single" 340 IsReadOnly="True" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}"> <DataGrid.GroupStyle> <GroupStyle> <GroupStyle.ContainerStyle> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GroupItem}"> <Expander IsExpanded="True"> <Expander.Header> <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"/> </Expander.Header> <ItemsPresenter /> </Expander> 341 </ControlTemplate> </Setter.Value> </Setter> </GroupStyle.ContainerStyle> <GroupStyle.Panel> <ItemsPanelTemplate> <DataGridRowsPresenter/> </ItemsPanelTemplate> </GroupStyle.Panel> </GroupStyle> </DataGrid.GroupStyle> <DataGrid.Columns> <DataGridTextColumn Header="Tree Types" Width="*" Binding="{Binding TreeType}"/> <DataGridTextColumn Header="CO2e per day" Width="*" Binding="{Binding CO2eUnitDay}"/> <DataGridTextColumn Header="CO2e per yearly" Width="*" Binding="{Binding CO2eUnitYear}"/> <DataGridTextColumn Header="Unit" Width="*" Binding="{Binding Unit.Value}"/> </DataGrid.Columns> 342 </DataGrid> </hc:SimplePanel> <DockPanel HorizontalAlignment="Right" Grid.Row="2"> </DockPanel> </Grid> </Grid> </Border> </local:WindowBase> UnitCarbonEmissionEditView.xaml <local:WindowBase x:Class="CarbonEmissio.Views.UnitCarbonEmissionEditView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup- compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:CarbonEmissio.Views" xmlns:hc="https://handyorg.github.io/handycontrol" mc:Ignorable="d" WindowStartupLocation="CenterScreen" 343 AllowsTransparency="True" Background="Transparent" WindowStyle="None" BorderBrush="Transparent" d:Height="410" Width="400" SizeToContent="Height"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" /> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> <Border Background="{DynamicResource BackgroundBrush}" Padding="10" CornerRadius="10" BorderThickness="1" BorderBrush="Black" Effect="{DynamicResource EffectShadow3}"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="10"/> <RowDefinition Height="auto"/> 344 <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> <RowDefinition Height="40"/> <RowDefinition Height="10"/> </Grid.RowDefinitions> <StackPanel Grid.Row="1" Orientation="Vertical"> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="Group" VerticalAlignment="Center" Margin="5" Width="70"/> <hc:AutoCompleteTextBox VerticalAlignment="Center" Margin="5" ItemsSource="{Binding Groups}" Text="{Binding Model.MaterialDefinition.Group}"/> </DockPanel> </StackPanel> <StackPanel Grid.Row="2" Orientation="Vertical" Visibility="{Binding IsSlide, Converter={StaticResource Boolean2VisibilityConverter}}"> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="Unit Type" VerticalAlignment="Center" Margin="5" Width="70"/> <hc:ComboBox VerticalAlignment="Center" Margin="5" SelectedValue="{Binding Model.MaterialDefinition.Unit.Key}" 345 ItemsSource="{Binding PressuredropUnits}" DisplayMemberPath="Value" SelectedValuePath="Key"/> </DockPanel> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="Min Value" VerticalAlignment="Center" Margin="5" Width="70"/> <hc:TextBox VerticalAlignment="Center" Margin="5" Text="{Binding Model.MaterialDefinition.Min}"/> </DockPanel> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="Max Value" VerticalAlignment="Center" Margin="5" Width="70"/> <hc:TextBox VerticalAlignment="Center" Margin="5" Text="{Binding Model.MaterialDefinition.Max}"/> </DockPanel> </StackPanel> <StackPanel Grid.Row="3" Orientation="Vertical"> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="Category" VerticalAlignment="Center" Margin="5" Width="70"/> <hc:TextBox VerticalAlignment="Center" Margin="5" IsReadOnly="{Binding IsSlide}" Text="{Binding 346 Model.MaterialDefinition.Name}"/> </DockPanel> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="Value Type" VerticalAlignment="Center" Margin="5" Width="70"/> <hc:ComboBox VerticalAlignment="Center" Margin="5" ItemsSource="{Binding ValueTypes}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding Model.Type.Key}"> <hc:Interaction.Triggers> <hc:EventTrigger EventName="SelectionChanged"> <hc:InvokeCommandAction Command="{Binding TypeChanged}" CommandParameter="{Binding SelectedValue, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=hc:ComboBox}}"/> </hc:EventTrigger> </hc:Interaction.Triggers> </hc:ComboBox> </DockPanel> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="Value Unit" VerticalAlignment="Center" Margin="5" Width="70"/> 347 <hc:ComboBox VerticalAlignment="Center" Margin="5" ItemsSource="{Binding ValueUnits}" DisplayMemberPath="Value" SelectedValuePath="Key" SelectedValue="{Binding Model.Unit.Key}"/> </DockPanel> <DockPanel Height="40"> <TextBlock DockPanel.Dock="Left" Text="Value" VerticalAlignment="Center" Margin="5" Width="70"/> <hc:TextBox VerticalAlignment="Center" Margin="5" Text="{Binding Model.Value}"/> </DockPanel> </StackPanel> <DockPanel HorizontalAlignment="Right" Grid.Row="4"> </DockPanel> </Grid> </Border> </local:WindowBase> 348 UnitCarbonEmissionView.xaml <local:WindowBase x:Class="CarbonEmissio.Views.UnitCarbonEmissionView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup- compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:CarbonEmissio.Views" xmlns:hc="https://handyorg.github.io/handycontrol" mc:Ignorable="d" WindowStartupLocation="CenterScreen" AllowsTransparency="True" Background="Transparent" WindowStyle="None" BorderBrush="Transparent" Height="500" Width="600"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" /> <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" /> 349 </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> <Border Background="{DynamicResource BackgroundBrush}" Padding="5" CornerRadius="10" BorderThickness="1" BorderBrush="Black" Effect="{DynamicResource EffectShadow3}"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="40"/> <RowDefinition/> <RowDefinition Height="40"/> </Grid.RowDefinitions> <hc:SimplePanel Grid.Row="0"> <DockPanel HorizontalAlignment="Left"> </DockPanel> 350 <DockPanel HorizontalAlignment="Right"> </DockPanel> </hc:SimplePanel> <hc:SimplePanel Grid.Row="1"> <DataGrid Margin="5" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" SelectionMode="Single" IsReadOnly="True" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}"> <DataGrid.GroupStyle> <GroupStyle> <GroupStyle.ContainerStyle> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GroupItem}"> 351 <Expander IsExpanded="True"> <Expander.Header> <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"/> </Expander.Header> <ItemsPresenter /> </Expander> </ControlTemplate> </Setter.Value> </Setter> </GroupStyle.ContainerStyle> <GroupStyle.Panel> <ItemsPanelTemplate> <DataGridRowsPresenter/> </ItemsPanelTemplate> </GroupStyle.Panel> </GroupStyle> </DataGrid.GroupStyle> <DataGrid.Columns> <DataGridTextColumn Header="Category" 352 Width="3*" Binding="{Binding MaterialDefinition.Name}"/> <DataGridTextColumn Header="Unit Value" Width="*" Binding="{Binding Value}"/> <DataGridTextColumn Header="Unit" Width="*" Binding="{Binding Unit.Value}"/> </DataGrid.Columns> </DataGrid> </hc:SimplePanel> <DockPanel HorizontalAlignment="Right" Grid.Row="2"> </DockPanel> </Grid> </Border> </local:WindowBase> WindowBase.cs using CarbonEmissio.Models; using CarbonEmissio.ViewModels; using HandyControl.Controls; using System; 353 using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CarbonEmissio.Views { public class WindowBase:Window { public WindowBase(ViewModelBase vm) { Vm = vm; vm.CloseCommand= new BaseCommand(() => { try { this.DialogResult = false; } catch { 354 } finally { this.Close(); } }); vm.AcceptCommand= new BaseCommand(() => { try { this.DialogResult = true; } catch { } finally { this.Close(); } }); 355 vm.CancelCommand= new BaseCommand(() => { try { this.DialogResult = false; } catch { } finally { this.Close(); } }); vm.DragWindowCommand = new BaseCommand(() => { this.DragMove(); }); 356 if(vm.IsCanDrag) { this.MouseLeftButtonDown += WindowBase_MouseLeftButtonDown; } this.Loaded += WindowBase_Loaded; } private void WindowBase_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { Vm.DragWindowCommand.Execute(null); } public ViewModelBase Vm { get; } private void WindowBase_Loaded(object sender, System.Windows.RoutedEventArgs e) { Vm.Dispatcher = this.Dispatcher; this.DataContext = Vm; 357 Vm.Loaded(); } } } ExternalApplication.cs using Autodesk.Revit.Attributes; using Autodesk.Revit.UI; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media.Imaging; namespace CarbonEmissio { /// /// called when revit is start up or shut down /// [Transaction(TransactionMode.Manual)] public class ExternalApplication : IExternalApplication 358 { /// /// on shut down /// /// /// <returns>revit result,like true or false</returns> public Result OnShutdown(UIControlledApplication application) { return Result.Succeeded; } /// /// on start up /// /// /// <returns>revit result,like true or false</returns> public Result OnStartup(UIControlledApplication application) { // tab name // allow system default or customization string tabName = "Carbon Emissio"; // need to create tab when customize new 359 application.CreateRibbonTab(tabName); // panel name // create a button panel string panelName= "Calculation"; RibbonPanel panel =application.CreateRibbonPanel(tabName, panelName); // create a separator in this panel,not must panel.AddSeparator(); // create a button in this panel string buttonName = "Architectural"; string buttonTip = "Calculate carbon emissions based on building materials"; string imgPath = @"images\Architectural.png"; Type commandType = typeof(ExternalCommand);//button command,a class inherit Autodesk.Revit.UI.IExternalCommand string assemblyName=new Uri(commandType.Assembly.CodeBase).LocalPath; PushButtonData buttonData = new PushButtonData(buttonName, buttonName, assemblyName, commandType.FullName); 360 PushButton button = panel.AddItem(buttonData) as PushButton; button.ToolTip=buttonTip; button.LargeImage = new BitmapImage(new Uri(imgPath)); return Result.Succeeded; } } } ExternalCommand.cs using Autodesk.Revit.Attributes; using Autodesk.Revit.DB; using Autodesk.Revit.UI; using CarbonEmissio.ViewModels; using CarbonEmissio.Views; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CarbonEmissio 361 { [Transaction(TransactionMode.Manual)] public class ExternalCommand : IExternalCommand { public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { UIDocument uidoc = commandData.Application.ActiveUIDocument; Document doc = uidoc.Document; CarbonEmissionViewModel vm = new CarbonEmissionViewModel(doc); CarbonEmissionView view=new CarbonEmissionView(vm); view.ShowDialog(); return Result.Succeeded; } } }
Abstract (if available)
Abstract
More attention is being concentrated on the embodied carbon and operational carbon performance by enterprises, corporations, and governments while designers, architects, and engineers need information about building materials to make smarter choices. EC3 is a very useful tool that focuses on the upfront supply chain emissions of construction materials and can work with BIM to calculate the carbon emission with the standard of the United States. Carbon Accounting Tool (CAT), a separate plug-in is created with C# programming language for the secondary development in Revit 2023. This plug-in is different from EC3 by selecting trees from various climate zones to be planted to achieve carbon offsets, and the remaining carbon can be purchased at a price based on the real-time carbon credit price.
The final plug-in can read the materials of the Revit building model through element materials and calculate the total amount of embodied carbon for each material in the current volume according to the carbon spreadsheet defined in advance. Then the user can freely select the tree types in different climate zones according to the building location or select a certain mass of trees to make the current building carbon neutral according to the pre-defined value of embodied carbon that can be absorbed by each tree of different types. If there is any remaining carbon that cannot be neutralized, the user can find out how many carbon credits to purchase and the price in the last step of the carbon trading interface in the plug-in.
Linked assets
University of Southern California Dissertations and Theses
Conceptually similar
PDF
Embodied carbon of wood construction: early assessment for design evaluation
PDF
Automating fire code compliance using BIM and Revit plug-ins
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
Streamlining precast back-frame design: automated design using Revit plugin
PDF
Revit plugins for electrical engineering improvements in buildings: Lighting power density and electrical equipment placement
PDF
MM Electrical Tool: a tool for generating electrical single line diagrams in BIM
PDF
Real-time simulation-based feedback on carbon impacts for user-engaged temperature management
PDF
Digital tree simulation for residential building energy savings: shading and evapotranspiration
PDF
BIM+AR in architecture: a building maintenance application for a smart phone
PDF
Simplified acoustic simulation - Rutabaga Acoustics: a Grasshopper plug-in for Rhino
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
Building bridges: filling gaps between BIM and other tools in mechanical design
PDF
Lightnet: a Web based teaching tool
PDF
Guidelines to airport design: accounting for glare from buildings during takeoff and landing – an LAX case study
PDF
Tilted glazing: angle-dependence of direct solar heat gain and form-refining of complex facades
PDF
Shading mask: a computer-based teaching tool for sun shading devices
PDF
Double skin façades performance: effects on daylight and visual comfort in office spaces
PDF
Daylight prediction: an evaluation of daylighting simulation software for four cases
PDF
Energy simulation in existing buildings: calibrating the model for retrofit studies
Asset Metadata
Creator
Sun, Xiangyu
(author)
Core Title
Carbon accounting tool (CAT) in BIM: an embodied carbon plug-in for revit
School
School of Architecture
Degree
Master of Building Science
Degree Program
Building Science
Degree Conferral Date
2023-05
Publication Date
05/02/2023
Defense Date
03/29/2023
Publisher
University of Southern California
(original),
University of Southern California. Libraries
(digital)
Tag
C# programming,carbon accounting,carbon trading,OAI-PMH Harvest,Revit API
Format
theses
(aat)
Language
English
Contributor
Electronically uploaded by the author
(provenance)
Advisor
Kensek, Karen M. (
committee chair
), Schiler, Marc (
committee member
), Zhao, Stan (
committee member
)
Creator Email
elegantyushao@163.com,sunxiang@usc.edu
Permanent Link (DOI)
https://doi.org/10.25549/usctheses-oUC113096991
Unique identifier
UC113096991
Identifier
etd-SunXiangyu-11752.pdf (filename)
Legacy Identifier
etd-SunXiangyu-11752
Document Type
Thesis
Format
theses (aat)
Rights
Sun, Xiangyu
Internet Media Type
application/pdf
Type
texts
Source
20230503-usctheses-batch-1035
(batch),
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 author, as the original true and official version of the work, but does not grant the reader permission to use the work if the desired use is covered by copyright. It is the author, as rights holder, who must provide use permission if such use is covered by copyright.
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
Repository Email
cisadmin@lib.usc.edu
Tags
C# programming
carbon accounting
carbon trading
Revit API