├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── packages └── EnergyAnalysisForDynamo │ ├── dyf │ └── IterativeGlazing.dyf │ └── extra │ ├── EnergyAnalysisForDynamo_ex1_simpleRevitMass.rvt │ ├── EnergyAnalysisForDynamo_ex1a_SetProjectEnergySettings.dyn │ ├── EnergyAnalysisForDynamo_ex1b_CreateEnergyModelAndSetSurfaceParams.dyn │ ├── EnergyAnalysisForDynamo_ex1c_CreateEnergyModelAndSetZoneParams.dyn │ ├── EnergyAnalysisForDynamo_ex1d_iterativeAnalysisExample.dyn │ ├── EnergyAnalysisForDynamo_ex1e_SetSurfaceParamsByOrientation.dyn │ ├── EnergyAnalysisForDynamo_ex2_fancyRevitMass.rvt │ ├── EnergyAnalysisForDynamo_ex2a_DriveSurfacesByOrientation.dyn │ ├── EnergyAnalysisForDynamo_ex3_simpleRevitMassWithFloor.rvt │ ├── EnergyAnalysisForDynamo_ex3a_CreategbXMLfromMass.dyn │ ├── EnergyAnalysisForDynamo_ex3b_CreategbXMLfromZones.dyn │ ├── EnergyAnalysisForDynamo_ex4a_CreateNewProjectAndGetProjectLists.dyn │ ├── EnergyAnalysisForDynamo_ex4b_UploadgbxmlAndCreateBaseRun.dyn │ ├── EnergyAnalysisForDynamo_ex5a_GetRunResultsSummary.dyn │ └── EnergyAnalysisForDynamo_ex6_DownloadDetailedResults.dyn └── src ├── EnergyAnalysisForDynamo.sln ├── EnergyAnalysisForDynamo ├── EnergyAnalysisForDynamo.csproj ├── EnergyAnalysisForDynamo_DynamoCustomization.xml ├── EnergySettings.cs ├── GetAnalysisResults.cs ├── PrepareEnergyModel.cs ├── Properties │ └── AssemblyInfo.cs ├── RunAnalysis.cs └── Utilities │ ├── ApiUri.cs │ ├── Contract.cs │ ├── ElementId.cs │ ├── Helper.cs │ ├── SingleSignOnManager.cs │ └── ZipUtil.cs ├── EnergyAnalysisForDynamoTests ├── EnergyAnalysisForDynamoTests.csproj ├── Properties │ └── AssemblyInfo.cs └── SystemTests.cs ├── EnergyAnalysisForDynamo_UI ├── EnergyAnalysisForDynamoDropdowns.cs ├── EnergyAnalysisForDynamo_UI.csproj └── Properties │ └── AssemblyInfo.cs ├── StartEnergyAnalysisForDynamo_Debug.bat ├── TestServices.dll.config ├── config └── CS.props └── packages ├── EnergyAnalysisforDynamoAuthHelper.dll ├── ICSharpCode.SharpZipLib.dll └── README.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | [Dd]ebug/ 46 | [Rr]elease/ 47 | *_i.c 48 | *_p.c 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.vspscc 63 | .builds 64 | *.dotCover 65 | 66 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 67 | #packages/ 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | 76 | # Visual Studio profiler 77 | *.psess 78 | *.vsp 79 | 80 | # ReSharper is a .NET coding add-in 81 | _ReSharper* 82 | 83 | # Installshield output folder 84 | [Ee]xpress 85 | 86 | # DocProject is a documentation generator add-in 87 | DocProject/buildhelp/ 88 | DocProject/Help/*.HxT 89 | DocProject/Help/*.HxC 90 | DocProject/Help/*.hhc 91 | DocProject/Help/*.hhk 92 | DocProject/Help/*.hhp 93 | DocProject/Help/Html2 94 | DocProject/Help/html 95 | 96 | # Click-Once directory 97 | publish 98 | 99 | # Others 100 | [Bb]in 101 | [Oo]bj 102 | sql 103 | TestResults 104 | *.Cache 105 | ClientBin 106 | stylecop.* 107 | ~$* 108 | *.dbmdl 109 | Generated_Code #added for RIA/Silverlight projects 110 | 111 | # Backup & report files from converting an old project file to a newer 112 | # Visual Studio version. Backup files are not needed, because we have git ;-) 113 | _UpgradeReport_Files/ 114 | Backup*/ 115 | UpgradeLog*.XML 116 | 117 | 118 | 119 | ############ 120 | ## Windows 121 | ############ 122 | 123 | # Windows image file caches 124 | Thumbs.db 125 | 126 | # Folder config file 127 | Desktop.ini 128 | 129 | 130 | ############# 131 | ## Python 132 | ############# 133 | 134 | *.py[co] 135 | 136 | # Packages 137 | *.egg 138 | *.egg-info 139 | dist 140 | build 141 | eggs 142 | parts 143 | bin 144 | var 145 | sdist 146 | develop-eggs 147 | .installed.cfg 148 | 149 | # Installer logs 150 | pip-log.txt 151 | 152 | # Unit test / coverage reports 153 | .coverage 154 | .tox 155 | 156 | #Translations 157 | *.mo 158 | 159 | #Mr Developer 160 | .mr.developer.cfg 161 | 162 | # Mac crap 163 | .DS_Store 164 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Autodesk, Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | EnergyAnalysisForDynamo 2 | ============ 3 | 4 | EnergyAnalysisForDynamo is a parametric interface for [Autodesk Green Building Studio](https://gbs.autodesk.com/GBS/), built on top of [Dynamo](http://dynamobim.org/) and [Revit](http://www.autodesk.com/products/revit-family/overview). The project will enable parametric energy modeling and whole-building energy analysis workflows in Dynamo 0.8 and Revit. 5 | 6 | The project is being developed in C# using Visual Studio, and will work with Dynamo 0.8.0, and Revit 2014 and 2015. The project consists of two libraries; one is a [zero-touch library](https://github.com/DynamoDS/Dynamo/wiki/Zero-Touch-Plugin-Development) containing most of the nodes, the other is a UI library containing a few nodes with dropdown elements. 7 | 8 | 9 | We are developing nodes in three main categories: 10 | 11 | - Parametric Energy Modeling. These nodes will allow conceptual energy models in the Revit massing environment to be driven on a zone-by-zone and surface-by-surface level of detail, and will expose control of the project’s default energy settings from within Dynamo. For example, you will be able to drive the glazing percentage of a surface based on orientation, or set the space type of a zone based on elevation. Please see the video at the bottom of this post for an example. 12 | 13 | - gbXML compilation and upload to Green Building Studio. These nodes will convert an analytical model in Revit into a gbXML file, which can be saved locally or uploaded to GBS to be run on the cloud. 14 | 15 | - Green Building Studio analysis results query and visualization. These nodes will query the GBS web service and return numeric results that can be used for data visualization. All of the nodes that interact with the GBS web service will use the Autodesk Single Sign On credentials from Revit for authentication. 16 | 17 | 18 | EnergyAnalysisForDynamo is developed and maintained by [Thornton Tomasetti](http://www.thorntontomasetti.com/)’s [CORE studio](http://core.thorntontomasetti.com/). The main developers are: 19 | - [Elcin Ertugrul](https://github.com/eertugrul) 20 | - [Mostapha Sadeghipour Roudsari](https://github.com/mostaphaRoudsari) 21 | - [Benjamin Howes](https://github.com/bhowes-tt) 22 | -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/dyf/IterativeGlazing.dyf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex1_simpleRevitMass.rvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/EnergyAnalysisForDynamo/ae855b60f47e8e08d112e7fdf09d72337bfc02d5/packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex1_simpleRevitMass.rvt -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex1a_SetProjectEnergySettings.dyn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0.5 6 | 7 | 8 | 9 | 0 10 | 11 | 12 | 13 | 0 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 10 28 | 29 | 30 | 31 | True 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex1b_CreateEnergyModelAndSetSurfaceParams.dyn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0.3 10 | 11 | 12 | 13 | 0.6 14 | 15 | 16 | 17 | 1.8 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex1c_CreateEnergyModelAndSetZoneParams.dyn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 3 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex1d_iterativeAnalysisExample.dyn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | C:\Users\EErtugrul\Desktop\delete\DYNAMO2.5 Test\iterativegbXML 26 | 27 | 28 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex1e_SetSurfaceParamsByOrientation.dyn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex2_fancyRevitMass.rvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/EnergyAnalysisForDynamo/ae855b60f47e8e08d112e7fdf09d72337bfc02d5/packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex2_fancyRevitMass.rvt -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex2a_DriveSurfacesByOrientation.dyn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0.2 10 | 11 | 12 | 13 | 0.8 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex3_simpleRevitMassWithFloor.rvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/EnergyAnalysisForDynamo/ae855b60f47e8e08d112e7fdf09d72337bfc02d5/packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex3_simpleRevitMassWithFloor.rvt -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex3a_CreategbXMLfromMass.dyn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | True 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex3b_CreategbXMLfromZones.dyn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | True 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex4a_CreateNewProjectAndGetProjectLists.dyn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | True 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex4b_UploadgbxmlAndCreateBaseRun.dyn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | C:\Users\BHowes\Desktop\EA4D_ExampleGbxmlFromMass.xml 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex5a_GetRunResultsSummary.dyn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | True 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /packages/EnergyAnalysisForDynamo/extra/EnergyAnalysisForDynamo_ex6_DownloadDetailedResults.dyn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | True 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | C:\Users\BHowes\Desktop 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamo.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.31101.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnergyAnalysisForDynamo", "EnergyAnalysisForDynamo\EnergyAnalysisForDynamo.csproj", "{213D4BB4-4736-48AE-A9B3-4D7BCE2E8D39}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnergyAnalysisForDynamo_UI", "EnergyAnalysisForDynamo_UI\EnergyAnalysisForDynamo_UI.csproj", "{8576F024-8D64-4F83-95A8-623D437AF502}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnergyAnalysisForDynamoTests", "EnergyAnalysisForDynamoTests\EnergyAnalysisForDynamoTests.csproj", "{FFC824C4-08A8-49A1-AA0B-80AAD9913C16}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {213D4BB4-4736-48AE-A9B3-4D7BCE2E8D39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {213D4BB4-4736-48AE-A9B3-4D7BCE2E8D39}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {213D4BB4-4736-48AE-A9B3-4D7BCE2E8D39}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {213D4BB4-4736-48AE-A9B3-4D7BCE2E8D39}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {8576F024-8D64-4F83-95A8-623D437AF502}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {8576F024-8D64-4F83-95A8-623D437AF502}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {8576F024-8D64-4F83-95A8-623D437AF502}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {8576F024-8D64-4F83-95A8-623D437AF502}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {FFC824C4-08A8-49A1-AA0B-80AAD9913C16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {FFC824C4-08A8-49A1-AA0B-80AAD9913C16}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {FFC824C4-08A8-49A1-AA0B-80AAD9913C16}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {FFC824C4-08A8-49A1-AA0B-80AAD9913C16}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | EndGlobal 35 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamo/EnergyAnalysisForDynamo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Debug 8 | AnyCPU 9 | 8.0.30703 10 | 2.0 11 | {213D4BB4-4736-48AE-A9B3-4D7BCE2E8D39} 12 | Library 13 | Properties 14 | EnergyAnalysisForDynamo 15 | EnergyAnalysisForDynamo 16 | v4.5 17 | 512 18 | 19 | 20 | 21 | true 22 | full 23 | false 24 | $(OutputPath) 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | $(OutputPath)\EnergyAnalysisForDynamo.XML 29 | false 30 | 31 | 32 | pdbonly 33 | true 34 | $(OutputPath) 35 | TRACE 36 | prompt 37 | 4 38 | $(OutputPath)\EnergyAnalysisForDynamo.XML 39 | 40 | 41 | 42 | $(DYNAMO_API)\DynamoCore.dll 43 | False 44 | 45 | 46 | $(DYNAMO_API)\DynamoServices.dll 47 | False 48 | 49 | 50 | $(DYNAMO_API)\DynamoUtilities.dll 51 | False 52 | 53 | 54 | ..\packages\EnergyAnalysisforDynamoAuthHelper.dll 55 | 56 | 57 | False 58 | ..\packages\ICSharpCode.SharpZipLib.dll 59 | True 60 | 61 | 62 | 63 | $(DYNAMO_API)\ProtoCore.dll 64 | False 65 | 66 | 67 | $(DYNAMO_API)\ProtoGeometry.dll 68 | False 69 | 70 | 71 | False 72 | $(REVIT_API)\RevitAPI.dll 73 | False 74 | False 75 | 76 | 77 | $(REVIT_API)\RevitAPIUI.dll 78 | False 79 | False 80 | 81 | 82 | $(DYNAMOREVIT_API)\$(REVIT_VERSION)\RevitNodes.dll 83 | False 84 | 85 | 86 | $(DYNAMOREVIT_API)\$(REVIT_VERSION)\RevitServices.dll 87 | False 88 | 89 | 90 | $(REVIT_API)\SSONET.dll 91 | False 92 | 93 | 94 | $(REVIT_API)\SSONETUI.dll 95 | False 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | copy "$(ProjectDir)\EnergyAnalysisForDynamo_DynamoCustomization.xml" "$(TargetDir)\EnergyAnalysisForDynamo_DynamoCustomization.xml" 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamo/EnergyAnalysisForDynamo_DynamoCustomization.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | EnergyAnalysisForDynamo 5 | 6 | 7 | 8 | EnergyAnalysisForDynamo 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamo/EnergySettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Xml; 6 | 7 | //Revit & Dynamo 8 | using Autodesk.Revit.DB; 9 | using Autodesk.Revit.DB.Analysis; 10 | using Autodesk.Revit.UI; 11 | using Dynamo.Models; 12 | using Dynamo.Graph.Nodes; 13 | using Dynamo.Utilities; 14 | using RevitServices.Persistence; 15 | using RevitServices.Transactions; 16 | using Autodesk.DesignScript.Runtime; 17 | using Revit.GeometryConversion; 18 | 19 | 20 | namespace EnergyAnalysisForDynamo 21 | { 22 | public static class EnergySettings 23 | { 24 | /// 25 | /// Gets existing Energy Data Settings from current document 26 | /// 27 | /// 28 | [MultiReturn("BldgType", "GlzPer", "SkylightPer", "ShadeDepth", "HVACSystem", "OSchedule", "CoreOffset", "DividePerimeter")] 29 | public static Dictionary GetEnergySettings() 30 | { 31 | // Get current document 32 | Document RvtDoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument.Document; 33 | 34 | // Load the default energy setting from the active Revit instance 35 | EnergyDataSettings es = Autodesk.Revit.DB.Analysis.EnergyDataSettings.GetFromDocument(RvtDoc); 36 | 37 | 38 | return new Dictionary 39 | { 40 | { "BldgType", Enum.GetName(typeof(gbXMLBuildingType), es.BuildingType)}, 41 | { "GlzPer", es.PercentageGlazing}, 42 | {"SkylightPer", es.PercentageSkylights}, 43 | { "ShadeDepth", es.ShadeDepth}, 44 | // { "ShadeDepth", es.ShadeDepth * UnitConverter.HostToDynamoFactor}, 45 | { "HVACSystem",Enum.GetName(typeof(gbXMLBuildingHVACSystem), es.BuildingHVACSystem)}, 46 | { "OSchedule",Enum.GetName(typeof(gbXMLBuildingOperatingSchedule), es.BuildingOperatingSchedule)}, 47 | {"CoreOffset", es.MassZoneCoreOffset}, 48 | {"DividePerimeter", es.MassZoneDividePerimeter} 49 | }; 50 | 51 | 52 | // User Visible Versions NOTE: this available in only Revit 2015 API 53 | //EnergyDataSettings es = EnergyDataSettings.GetFromDocument(RvtDoc); 54 | 55 | //es.get_Parameter(BuiltInParameter.ENERGY_ANALYSIS_HVAC_SYSTEM).AsValueString(); 56 | 57 | } 58 | 59 | /// 60 | /// Sets the Enegry Data Settings 61 | /// 62 | /// Input Building Type 63 | /// Input glazing percentage (range: 0 to 1) 64 | /// Shading Depth, specified as a double. We assume the double value represents a length using Dynamo's current length unit. 65 | /// Input skylight percentage (range: 0 to 1) 66 | /// Input Building HVAC system 67 | /// Input Building Operating Schedule 68 | /// Input Core Offset as a double. Default value is 15'0"(IP) and 5 meters(SI). Set the value to 0 not to create perimeter zones. 69 | /// Set to false not to divide perimeter zones. Default is true. 70 | /// 71 | [MultiReturn("EnergySettings", "report")] 72 | public static Dictionary SetEnergySettings(string BldgTyp = "", double GlzPer = 0, double ShadeDepth = 0, double SkylightPer = 0, string HVACSystem = "", string OSchedule = "", double CoreOffset = -1, bool DividePerimeter = true) 73 | { 74 | 75 | //Get active document 76 | Document RvtDoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument.Document; 77 | 78 | //enable the analytical model in the document if it isn't already 79 | try 80 | { 81 | PrepareEnergyModel.ActivateEnergyModel(RvtDoc); 82 | } 83 | catch (Exception) 84 | { 85 | throw new Exception("Something went wrong when trying to enable the energy model."); 86 | } 87 | 88 | //Load the default energy setting from the active Revit instance 89 | EnergyDataSettings myEnergySettings = Autodesk.Revit.DB.Analysis.EnergyDataSettings.GetFromDocument(RvtDoc); 90 | 91 | //make sure we are in a transaction 92 | TransactionManager.Instance.EnsureInTransaction(RvtDoc); 93 | 94 | if (!string.IsNullOrEmpty(BldgTyp)) 95 | { 96 | Autodesk.Revit.DB.Analysis.gbXMLBuildingType type; 97 | try 98 | { 99 | type = (Autodesk.Revit.DB.Analysis.gbXMLBuildingType)Enum.Parse(typeof(Autodesk.Revit.DB.Analysis.gbXMLBuildingType), BldgTyp); 100 | } 101 | catch (Exception) 102 | { 103 | throw new Exception("Building type is not found"); 104 | } 105 | myEnergySettings.BuildingType = type; 106 | } 107 | 108 | if (!string.IsNullOrEmpty(HVACSystem)) 109 | { 110 | Autodesk.Revit.DB.Analysis.gbXMLBuildingHVACSystem type; 111 | try 112 | { 113 | type = (Autodesk.Revit.DB.Analysis.gbXMLBuildingHVACSystem)Enum.Parse(typeof(Autodesk.Revit.DB.Analysis.gbXMLBuildingHVACSystem), HVACSystem); 114 | } 115 | catch (Exception) 116 | { 117 | throw new Exception("HVAC system is not found"); 118 | } 119 | myEnergySettings.BuildingHVACSystem = type; 120 | } 121 | 122 | if (!string.IsNullOrEmpty(OSchedule)) 123 | { 124 | Autodesk.Revit.DB.Analysis.gbXMLBuildingOperatingSchedule type; 125 | try 126 | { 127 | type = (Autodesk.Revit.DB.Analysis.gbXMLBuildingOperatingSchedule)Enum.Parse(typeof(Autodesk.Revit.DB.Analysis.gbXMLBuildingOperatingSchedule), OSchedule); 128 | } 129 | catch (Exception) 130 | { 131 | throw new Exception("Operating Schedule is not found"); 132 | } 133 | myEnergySettings.BuildingOperatingSchedule = type; 134 | } 135 | 136 | if (GlzPer > 0.0 && GlzPer <= 1.0) 137 | { 138 | try 139 | { 140 | myEnergySettings.PercentageGlazing = GlzPer; 141 | } 142 | catch (Exception) 143 | { 144 | throw new Exception("The Glazing Percentage input range should be 0 - 1"); 145 | } 146 | } 147 | 148 | if (ShadeDepth > 0.0) 149 | { 150 | myEnergySettings.IsGlazingShaded = true; 151 | //myEnergySettings.ShadeDepth = ShadeDepth * UnitConverter.DynamoToHostFactor; 152 | myEnergySettings.ShadeDepth = ShadeDepth; 153 | } 154 | else 155 | { 156 | myEnergySettings.IsGlazingShaded = false; 157 | myEnergySettings.ShadeDepth = 0; 158 | } 159 | 160 | // add skylight percentage 161 | myEnergySettings.PercentageSkylights = SkylightPer; 162 | 163 | // set core-perimeter parameters 164 | if (CoreOffset >= 0) 165 | { 166 | //myEnergySettings.MassZoneCoreOffset = CoreOffset * UnitConverter.DynamoToHostFactor; 167 | myEnergySettings.MassZoneCoreOffset = CoreOffset; 168 | } 169 | 170 | // set divide perimeter 171 | myEnergySettings.MassZoneDividePerimeter = DividePerimeter; 172 | 173 | 174 | //done with the transaction 175 | TransactionManager.Instance.TransactionTaskDone(); 176 | 177 | // Report 178 | string report = "Building type is " + Enum.GetName(typeof(gbXMLBuildingType), myEnergySettings.BuildingType) + ".\n" + 179 | "Glazing percentage is set to " + myEnergySettings.PercentageGlazing.ToString() + ".\n" + 180 | "Shading depth is " + ShadeDepth.ToString() + ".\n" + 181 | "Current HVAC system is " + Enum.GetName(typeof(gbXMLBuildingHVACSystem), myEnergySettings.BuildingHVACSystem) + ".\n" + 182 | "Current Operating Schedule is " + Enum.GetName(typeof(gbXMLBuildingOperatingSchedule), myEnergySettings.BuildingOperatingSchedule) + "."; 183 | 184 | return new Dictionary 185 | { 186 | { "EnergySettings", myEnergySettings}, 187 | { "report", report} 188 | }; 189 | } 190 | 191 | } 192 | } 193 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("EnergyAnalysisForDynamo")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Thornton Tomasetti, Inc.")] 12 | [assembly: AssemblyProduct("EnergyAnalysisForDynamo")] 13 | [assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0870ea08-e2e7-43b4-8776-b2e488be22d0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.2.42")] 36 | [assembly: AssemblyFileVersion("0.2.42")] 37 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamo/RunAnalysis.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Xml; 6 | using System.IO; 7 | using System.Reflection; 8 | using System.Threading; 9 | using System.Text; 10 | using System.Net; 11 | 12 | // Serialization 13 | using System.Runtime.Serialization; 14 | //using System.Runtime.Serialization.Json; 15 | 16 | //Autodesk 17 | using Autodesk.Revit; 18 | using Autodesk.Revit.DB; 19 | using Autodesk.Revit.DB.Analysis; 20 | using Autodesk.DesignScript.Runtime; 21 | 22 | //Dynamo 23 | 24 | using Dynamo.Models; 25 | using Dynamo.Graph.Nodes; 26 | using Dynamo.Utilities; 27 | using RevitServices.Persistence; 28 | using RevitServices.Transactions; 29 | using RevitServices.Elements; 30 | using Dynamo; 31 | 32 | //Revit Services 33 | using RevitServices; 34 | 35 | //AuthHelper 36 | using EnergyAnalysisforDynamoAuthHelper; 37 | 38 | //Helper 39 | using EnergyAnalysisForDynamo.Utilities; 40 | using EnergyAnalysisForDynamo.DataContracts; 41 | 42 | //DataContract 43 | using Revit.Elements; 44 | using System.Xml.Linq; 45 | using System.Diagnostics; 46 | 47 | namespace EnergyAnalysisForDynamo 48 | { 49 | public static class RunAnalysis 50 | { 51 | 52 | // NODE: Create Base Run 53 | /// 54 | /// Uploads and runs the energy analysis at the cloud and returns 'RunId' for results. Will return 0 for output 'RunId' if the request times out, currenlty set 5 mins. GBS Project location information overwrites the gbxml file location. If gbXML locations are variant, create new Project for each. 55 | /// 56 | /// Input Project ID 57 | /// Input file path of gbXML File 58 | /// Set to true to execute parametric runs. You can read more about parametric runs here: http://autodesk.typepad.com/bpa/ 59 | /// /// Set custom connection timeout value. Default is 300000 ms (2 mins) 60 | /// 61 | [MultiReturn("RunIds","UploadTimes","Report")] 62 | public static Dictionary> RunEnergyAnalysis(int ProjectId, List gbXMLPaths, bool ExecuteParametricRuns = false, int Timeout = 300000) 63 | { 64 | // Make sure the given file is an .xml 65 | foreach (var gbXMLPath in gbXMLPaths) 66 | { 67 | // check if it is exist 68 | if (!File.Exists(gbXMLPath)) 69 | { 70 | throw new Exception("The file doesn't exists!"); 71 | } 72 | 73 | string extention = string.Empty; 74 | try 75 | { 76 | extention = Path.GetExtension(gbXMLPath); 77 | } 78 | catch (Exception ex) 79 | { 80 | throw new Exception(ex + "Use 'File Path' node to set the gbxml file location."); 81 | } 82 | 83 | if (extention != ".xml") 84 | { 85 | throw new Exception("Make sure to input files are gbxml files"); 86 | } 87 | 88 | } 89 | 90 | // 1. Initiate the Revit Auth 91 | Helper.InitRevitAuthProvider(); 92 | 93 | // 1.1 Turn off MassRuns 94 | try 95 | { 96 | Helper._ExecuteMassRuns(ExecuteParametricRuns, ProjectId); 97 | } 98 | catch (Exception) 99 | { 100 | // Do Nothing! 101 | } 102 | 103 | //Output variables 104 | List newRunIds = new List(); 105 | List uploadTimes = new List(); 106 | List Reports = new List(); 107 | 108 | foreach (var gbXMLPath in gbXMLPaths) 109 | { 110 | int newRunId = 0; 111 | Stopwatch stopwatch = new Stopwatch(); 112 | stopwatch.Start(); 113 | 114 | // 2. Create A Base Run 115 | string requestCreateBaseRunUri = GBSUri.GBSAPIUri + string.Format(APIV1Uri.CreateBaseRunUri, "xml"); 116 | HttpWebResponse response = null; 117 | try 118 | { 119 | response = 120 | (HttpWebResponse) 121 | Helper._CallPostApi(requestCreateBaseRunUri, typeof(NewRunItem), Helper._GetNewRunItem(ProjectId, gbXMLPath),Timeout); 122 | } 123 | catch (Exception) 124 | { 125 | string filename = Path.GetFileName(gbXMLPath); 126 | newRunIds.Add("Couldot run the analysis for the file: " + filename + " Try run the Analysis for this file again! "); 127 | } 128 | 129 | if (response != null) 130 | { 131 | newRunId = Helper.DeserializeHttpWebResponse(response); 132 | newRunIds.Add(newRunId); 133 | Reports.Add("Success!"); 134 | } 135 | else 136 | { 137 | newRunIds.Add(null); 138 | // get file name 139 | string filename = Path.GetFileName(gbXMLPath); 140 | Reports.Add("Couldn't upload gbxml file name : " + filename + ". Set timeout longer and try to run again! "); 141 | //throw new Exception("Couldot run the analysis for the file: " + filename ); 142 | } 143 | 144 | stopwatch.Stop(); 145 | uploadTimes.Add(stopwatch.Elapsed.ToString(@"m\:ss")); 146 | } 147 | 148 | // 3. Populate the Outputs 149 | return new Dictionary> 150 | { 151 | { "RunIds" , newRunIds}, 152 | { "UploadTimes" , uploadTimes}, 153 | { "Report" , Reports} 154 | }; 155 | } 156 | 157 | 158 | // NODE: Create new Project 159 | /// 160 | /// Creates new project in GBS and returns new Project ID. Returns ProjectID if the project with same title already exists. 161 | /// 162 | /// Title of the project 163 | /// 164 | [MultiReturn("ProjectId")] 165 | public static Dictionary CreateProject(string ProjectTitle) 166 | { 167 | //1. Output variable 168 | int newProjectId = 0; 169 | 170 | //2. Initiate the Revit Auth 171 | Helper.InitRevitAuthProvider(); 172 | 173 | //NOTE: GBS allows to duplicate Project Titles !!! from user point of view we would like keep Project Titles Unique. 174 | //Create Project node return the Id of a project if it already exists. If more than one project with the same name already exist, throw an exception telling the user that multiple projects with that name exist. 175 | 176 | //Check if the project exists 177 | List ExtngProjects = Helper.GetExistingProjectsTitles(); 178 | 179 | var queryProjects = from pr in ExtngProjects 180 | where pr.Title == ProjectTitle 181 | select pr; 182 | 183 | if (queryProjects.Any()) // Existing Project 184 | { 185 | // check if multiple projects 186 | if (queryProjects.Count() > 1) 187 | { 188 | // if there are multiple thow and exception 189 | throw new Exception("Multiple Projects with this title " + ProjectTitle + " exist. Try with a another name or use GetProjectList Node to get the existing GBS projects' attributes"); 190 | } 191 | else 192 | { 193 | newProjectId = queryProjects.First().Id; 194 | } 195 | } 196 | else //Create New Project 197 | { 198 | #region Setup : Get values from current Revit document 199 | 200 | //local variable to get SiteLocation and Lat & Lon information 201 | Document RvtDoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument.Document; 202 | 203 | //Load the default energy setting from the active Revit instance 204 | EnergyDataSettings myEnergySettings = Autodesk.Revit.DB.Analysis.EnergyDataSettings.GetFromDocument(RvtDoc); 205 | 206 | // get BuildingType and ScheduleId from document 207 | // Remap Revit enum/values to GBS enum/ values 208 | string RvtBldgtype = Enum.GetName(typeof(gbXMLBuildingType), myEnergySettings.BuildingType); 209 | int BuildingTypeId = Helper.RemapBldgType(RvtBldgtype); 210 | // this for comparison 211 | int RvtBuildingTypeId = (int)myEnergySettings.BuildingType; 212 | 213 | // Lets set the schedule ID to 1 for now 214 | //int ScheduleId = (int)myEnergySettings.BuildingOperatingSchedule; 215 | int ScheduleId = Helper.RemapScheduleType((int)myEnergySettings.BuildingOperatingSchedule); 216 | 217 | 218 | // Angles are in Rdaians when coming from revit API 219 | // Convert to lat & lon values 220 | const double angleRatio = Math.PI / 180; // angle conversion factor 221 | 222 | double lat = RvtDoc.SiteLocation.Latitude / angleRatio; 223 | double lon = RvtDoc.SiteLocation.Longitude / angleRatio; 224 | 225 | #endregion 226 | 227 | #region Setup : Get default Utility Values 228 | 229 | //1. Initiate the Revit Auth 230 | Helper.InitRevitAuthProvider(); 231 | 232 | // Try to get Default Utility Costs from API 233 | string requestGetDefaultUtilityCost = GBSUri.GBSAPIUri + APIV1Uri.GetDefaultUtilityCost; 234 | string requestUriforUtilityCost = string.Format(requestGetDefaultUtilityCost, BuildingTypeId, lat, lon, "xml"); 235 | HttpWebResponse responseUtility = (HttpWebResponse)Helper._CallGetApi(requestUriforUtilityCost); 236 | 237 | string theresponse = ""; 238 | using (Stream responseStream = responseUtility.GetResponseStream()) 239 | { 240 | using (StreamReader streamReader = new StreamReader(responseStream)) 241 | { 242 | theresponse = streamReader.ReadToEnd(); 243 | } 244 | } 245 | DefaultUtilityItem utilityCost = Helper.DataContractDeserialize(theresponse); 246 | 247 | #endregion 248 | 249 | // 2. Create A New Project 250 | string requestUri = GBSUri.GBSAPIUri + string.Format(APIV1Uri.CreateProjectUri, "xml"); 251 | 252 | var response = 253 | (HttpWebResponse) 254 | Helper._CallPostApi(requestUri, typeof(NewProjectItem), Helper._CreateProjectItem(ProjectTitle, false, BuildingTypeId, ScheduleId, lat, lon, utilityCost.ElecCost, utilityCost.FuelCost)); 255 | 256 | newProjectId = Helper.DeserializeHttpWebResponse(response); 257 | } 258 | 259 | // 3. Populate the Outputs 260 | return new Dictionary 261 | { 262 | { "ProjectId", newProjectId} 263 | }; 264 | } 265 | 266 | 267 | // NODE: Create gbXML from Mass 268 | /// 269 | /// Create gbXML file from Mass and saves to a local location 270 | /// 271 | /// Specify the file path location to save gbXML file 272 | /// Input Mass Id 273 | /// Input Mass Ids for shading objects 274 | /// Set Boolean True. Default is false 275 | /// Success? 276 | /// 277 | [MultiReturn("report", "gbXMLPath")] 278 | public static Dictionary ExportMassToGBXML(string FilePath, AbstractFamilyInstance MassFamilyInstance, List MassShadingInstances, Boolean Run = false) 279 | { 280 | // Local variables 281 | Boolean IsSuccess = false; 282 | string FileName = string.Empty; 283 | string Folder = string.Empty; 284 | 285 | // Check if path and directory valid 286 | if (System.String.IsNullOrEmpty(FilePath) || FilePath == "No file selected.") 287 | { 288 | throw new Exception("No File selected !"); 289 | } 290 | 291 | FileName = Path.GetFileNameWithoutExtension(FilePath); 292 | Folder = Path.GetDirectoryName(FilePath); 293 | 294 | // Check if Directory Exists 295 | if (!Directory.Exists(Folder)) 296 | { 297 | throw new Exception("Folder doesn't exist. Input valid Directory Path!"); 298 | } 299 | 300 | 301 | //make RUN? inputs set to True mandatory 302 | if (Run == false) 303 | { 304 | throw new Exception("Set 'Connect' to True!"); 305 | } 306 | 307 | //local variables 308 | Document RvtDoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument.Document; 309 | 310 | //enable the analytical model in the document if it isn't already 311 | try 312 | { 313 | PrepareEnergyModel.ActivateEnergyModel(RvtDoc); 314 | } 315 | catch (Exception) 316 | { 317 | throw new Exception("Something went wrong when trying to enable the energy model."); 318 | } 319 | 320 | //get the id of the analytical model associated with that mass 321 | Autodesk.Revit.DB.ElementId myEnergyModelId = MassEnergyAnalyticalModel.GetMassEnergyAnalyticalModelIdForMassInstance(RvtDoc, MassFamilyInstance.InternalElement.Id); 322 | if (myEnergyModelId.IntegerValue == -1) 323 | { 324 | throw new Exception("Could not get the MassEnergyAnalyticalModel from the mass - make sure the Mass has at least one Mass Floor."); 325 | } 326 | MassEnergyAnalyticalModel mea = (MassEnergyAnalyticalModel)RvtDoc.GetElement(myEnergyModelId); 327 | ICollection ZoneIds = mea.GetMassZoneIds(); 328 | 329 | 330 | 331 | // get shading Ids 332 | List ShadingIds = new List(); 333 | for (int i = 0; i < MassShadingInstances.Count(); i++) 334 | { 335 | 336 | // make sure input mass is valid as a shading 337 | if (MassInstanceUtils.GetMassLevelDataIds(RvtDoc, MassShadingInstances[i].InternalElement.Id).Count() > 0) 338 | { 339 | throw new Exception("Item " + i.ToString() + " in MassShadingInstances has mass floors assigned. Remove the mass floors and try again."); 340 | } 341 | 342 | ShadingIds.Add(MassShadingInstances[i].InternalElement.Id); 343 | } 344 | 345 | if (ShadingIds.Count != 0) 346 | { 347 | MassGBXMLExportOptions gbXmlExportOptions = new MassGBXMLExportOptions(ZoneIds.ToList(), ShadingIds); // two constructors 348 | RvtDoc.Export(Folder, FileName, gbXmlExportOptions); 349 | 350 | } 351 | else 352 | { 353 | MassGBXMLExportOptions gbXmlExportOptions = new MassGBXMLExportOptions(ZoneIds.ToList()); // two constructors 354 | RvtDoc.Export(Folder, FileName, gbXmlExportOptions); 355 | } 356 | 357 | 358 | // if the file exists return success message if not return failed message 359 | string path = Path.Combine(Folder, FileName + ".xml"); 360 | 361 | if (System.IO.File.Exists(path)) 362 | { 363 | // Modify the xml Program Info element, aithorize the 364 | XmlDocument doc = new XmlDocument(); 365 | doc.Load(path); 366 | 367 | // EE: There must be a shorter way ! 368 | XmlNode node = doc.DocumentElement; 369 | 370 | foreach (XmlNode node1 in node.ChildNodes) 371 | { 372 | foreach (XmlNode node2 in node1.ChildNodes) 373 | { 374 | if (node2.Name == "ProgramInfo") 375 | { 376 | foreach (XmlNode childnode in node2.ChildNodes) 377 | { 378 | if (childnode.Name == "ProductName") 379 | { 380 | string productname = "Dynamo _ " + childnode.InnerText; 381 | childnode.InnerText = productname; 382 | } 383 | } 384 | 385 | } 386 | } 387 | } 388 | 389 | //doc.DocumentElement.Attributes["ProgramInfo"].ChildNodes[1].Value += "Dynamo "; 390 | doc.Save(path); 391 | 392 | IsSuccess = true; 393 | } 394 | string message = "Failed to create gbXML file!"; 395 | 396 | if (IsSuccess) 397 | { 398 | message = "Success! The gbXML file was created"; 399 | } 400 | else 401 | { 402 | path = string.Empty; 403 | } 404 | 405 | // Populate Output Values 406 | return new Dictionary 407 | { 408 | { "report", message}, 409 | { "gbXMLPath", path} 410 | }; 411 | } 412 | 413 | 414 | // NODE: Create gbXML from Zones 415 | /// 416 | /// Exports gbXML file from Zones 417 | /// 418 | /// Specify the file path location to save gbXML file 419 | /// Input Zone IDs 420 | /// Input Mass Ids for shading objects 421 | /// Set Boolean True. Default is false 422 | /// Success? 423 | /// 424 | [MultiReturn("report", "gbXMLPath")] 425 | public static Dictionary ExportZonesToGBXML(string FilePath, List ZoneIds, List MassShadingInstances, Boolean Run = false) 426 | { 427 | // Local variables 428 | Boolean IsSuccess = false; 429 | string FileName = string.Empty; 430 | string Folder = string.Empty; 431 | 432 | // Check if path and directory valid 433 | if (System.String.IsNullOrEmpty(FilePath) || FilePath == "No file selected.") 434 | { 435 | throw new Exception("No File selected !"); 436 | } 437 | 438 | FileName = Path.GetFileNameWithoutExtension(FilePath); 439 | Folder = Path.GetDirectoryName(FilePath); 440 | 441 | // Check if Directory Exists 442 | if (!Directory.Exists(Folder)) 443 | { 444 | throw new Exception("Folder doesn't exist. Input valid Directory Path!"); 445 | } 446 | 447 | //make RUN? inputs set to True mandatory 448 | if (Run == false) 449 | { 450 | throw new Exception("Set 'Connect' to True!"); 451 | } 452 | 453 | //local varaibles 454 | Document RvtDoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument.Document; 455 | 456 | //enable the analytical model in the document if it isn't already 457 | try 458 | { 459 | PrepareEnergyModel.ActivateEnergyModel(RvtDoc); 460 | } 461 | catch (Exception) 462 | { 463 | throw new Exception("Something went wrong when trying to enable the energy model."); 464 | } 465 | 466 | //convert the ElementId wrapper instances to actual Revit ElementId objects 467 | List outZoneIds = ZoneIds.Select(e => new Autodesk.Revit.DB.ElementId(e.InternalId)).ToList(); 468 | 469 | 470 | // get shading Ids 471 | List ShadingIds = new List(); 472 | for (int i = 0; i < MassShadingInstances.Count(); i++) 473 | { 474 | 475 | // make sure input mass is valid as a shading 476 | if (MassInstanceUtils.GetMassLevelDataIds(RvtDoc, MassShadingInstances[i].InternalElement.Id).Count() > 0) 477 | { 478 | throw new Exception("Item " + i.ToString() + " in MassShadingInstances has mass floors assigned. Remove the mass floors and try again."); 479 | } 480 | 481 | ShadingIds.Add(MassShadingInstances[i].InternalElement.Id); 482 | } 483 | 484 | if (ShadingIds.Count != 0) 485 | { 486 | // Create gbXML with shadings 487 | MassGBXMLExportOptions gbXmlExportOptions = new MassGBXMLExportOptions(outZoneIds.ToList(), ShadingIds); // two constructors 488 | RvtDoc.Export(Folder, FileName, gbXmlExportOptions); 489 | 490 | } 491 | else 492 | { 493 | // Create gbXML 494 | MassGBXMLExportOptions gbXmlExportOptions = new MassGBXMLExportOptions(outZoneIds.ToList()); // two constructors 495 | RvtDoc.Export(Folder, FileName, gbXmlExportOptions); 496 | } 497 | 498 | 499 | // if the file exists return success message if not return failed message 500 | string path = Path.Combine(Folder, FileName + ".xml"); 501 | 502 | if (System.IO.File.Exists(path)) 503 | { 504 | // Modify the xml Program Info element, aithorize the 505 | XmlDocument doc = new XmlDocument(); 506 | doc.Load(path); 507 | 508 | // EE: There must be a shorter way ! 509 | XmlNode node = doc.DocumentElement; 510 | foreach (XmlNode node1 in node.ChildNodes) 511 | { 512 | foreach (XmlNode node2 in node1.ChildNodes) 513 | { 514 | if (node2.Name == "ProgramInfo") 515 | { 516 | foreach (XmlNode childnode in node2.ChildNodes) 517 | { 518 | if (childnode.Name == "ProductName") 519 | { 520 | string productname = "Dynamo _ " + childnode.InnerText; 521 | childnode.InnerText = productname; 522 | } 523 | } 524 | } 525 | } 526 | } 527 | 528 | doc.Save(path); 529 | 530 | IsSuccess = true; 531 | } 532 | string message = "Failed to create gbXML file!"; 533 | 534 | if (IsSuccess) 535 | { 536 | message = "Success! The gbXML file was created"; 537 | } 538 | else 539 | { 540 | path = string.Empty; 541 | } 542 | 543 | 544 | return new Dictionary 545 | { 546 | { "report", message}, 547 | { "gbXMLPath", path} 548 | }; 549 | 550 | 551 | } 552 | } 553 | } 554 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamo/Utilities/ApiUri.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | 8 | namespace EnergyAnalysisForDynamo.Utilities 9 | { 10 | internal class GBSUri 11 | { 12 | internal const string GBSAPIUri = @"https://gbs.autodesk.com/gbs/api"; 13 | internal const string DashboardAPIUri = @"https://gbs.autodesk.com/Dashboard/OpenAPI"; 14 | } 15 | 16 | internal static class APIV1Uri 17 | { 18 | //internal static string OpenApiUri = @"https://gbs.autodesk.com/gbs/api"; //GBSUri.GBSAPIUri; 19 | 20 | internal static string CreateProjectUri = @"/v1/project/create/{0}"; // 0-xml/json 21 | internal static string CreateBaseRunUri = @"/v1/run/create/base/{0}"; // 0-xml/json 22 | internal static string DeleteProjectUri = @"/v1/project/delete/{0}/{1}"; //0-projectid 23 | internal static string GetDefaultUtilityCost = @"/v1/project/defaultUtilityCost/{0}/{1}/{2}/{3}"; ///{buildingTypeId}/{latitude}/{longitude} 24 | internal static string GetBuildingTypesUri = @"/v1/project/buildingTypeList/{0}"; // 0 = response format "json" or default is xml 25 | internal static string GetScheduleListUri = @"/v1/project/scheduleList/{0}"; // 0 = response format "json" or default is xml 26 | internal static string GetProjectList = @"/v1/project/list/{0}"; //0 xml/json 27 | internal static string GetUtilityDataSetListUri = @"/v1/project/utilityDataSets/{0}/{1}"; // 0 = projectId, 1 = response format xml/json 28 | internal static string UploadUtilityDataSetUri = @"/projects/{0}/UtilityDataSet"; // 0 = projectId 29 | internal static string GetProjectRunListUri = @"/v1/project/runs/{0}/{1}"; // 0 = projectId, 1 = response format xml/json 30 | internal static string GetRunStatus = @"/v1/run/status/{0}/{1}/{2}";// 0 = runId, 1 =altrunid, 2 = response format xml/json 31 | internal static string GetRunResultsUri = @"/v1/run/results/{0}/{1}/{2}"; // 0 = runId, 1 = altRunId, 2=response payload 32 | internal static string GetRunSummaryResultsUri = @"/v1/run/results/summary/{0}/{1}/{2}"; // 0 = runId, 1 = altRunId, response format xml/json 33 | internal static string ControlMassRunInUserLevel = @"/v1/User/MassRunRight"; 34 | internal static string ControlMassRunInProjectLevel = @"/v1/Project/{0}/MassRunRight"; // 0 = projectId 35 | internal static string GetSimulationRunFile = @"/v1/run/file/GetSimulationRunFile/{0}/{1}/{2}"; // 0=runId 1 = altRunId, fileType = gbXML || doe2 ||eplus 36 | } 37 | 38 | internal class APIResultTypeUri 39 | { 40 | internal const string Uri = @"/resulttype"; 41 | internal const string RulerUri = @"/getResultTypeConfigurationRules/json"; 42 | internal const string DataUri = @"/getResultTypeData?returnTypeformat=json"; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamo/Utilities/ElementId.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Xml; 6 | using Autodesk.Revit.DB; 7 | using RevitServices.Persistence; 8 | using Autodesk.DesignScript.Runtime; 9 | 10 | namespace EnergyAnalysisForDynamo 11 | { 12 | /// 13 | /// Wrapper class for Autodesk.Revit.DB.ElementId. 14 | /// 15 | [IsVisibleInDynamoLibrary(false)] 16 | public class ElementId 17 | { 18 | //the revit ID that we are wrapping around. 19 | private Autodesk.Revit.DB.ElementId internalId; 20 | 21 | /// 22 | /// The int representation of the [Revit] Element Id. 23 | /// 24 | public int InternalId 25 | { 26 | [SupressImportIntoVM] 27 | get { return internalId.IntegerValue; } 28 | [SupressImportIntoVM] 29 | set 30 | { 31 | try 32 | { 33 | Document RvtDoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument.Document; 34 | Autodesk.Revit.DB.ElementId i = new Autodesk.Revit.DB.ElementId(value); 35 | internalId = RvtDoc.GetElement(i).Id; 36 | } 37 | catch (Exception ex) 38 | { 39 | throw new Exception("GBSforDynamo internal error - could not find a Revit Element with the specified ElementId. Here is the actual exception that was thrown by Revit: \n\n" + ex.ToString()); 40 | } 41 | } 42 | } 43 | 44 | /// 45 | /// Returns a string that represents the current object 46 | /// 47 | /// 48 | [SupressImportIntoVM] 49 | public override string ToString() 50 | { 51 | return internalId.ToString(); 52 | } 53 | 54 | /// 55 | /// New ElementId instance with int input to set the Id 56 | /// 57 | /// The int representation of a Revit ElementId 58 | [SupressImportIntoVM] 59 | public ElementId(int id) 60 | { 61 | InternalId = id; 62 | } 63 | 64 | /// 65 | /// Default constructor override 66 | /// 67 | [SupressImportIntoVM] 68 | public ElementId() { } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamo/Utilities/Helper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading; 7 | using System.Runtime.Serialization; 8 | using System.Runtime.Serialization.Json; 9 | using Autodesk.DesignScript.Runtime; 10 | using System.Net; 11 | 12 | // Revit 13 | using Autodesk.Revit; 14 | using Autodesk.Revit.DB; 15 | using Autodesk.Revit.DB.Analysis; 16 | using RevitServices.Persistence; 17 | 18 | //Revit Services 19 | using RevitServices; 20 | 21 | //AuthHelper 22 | using EnergyAnalysisforDynamoAuthHelper; 23 | 24 | using EnergyAnalysisForDynamo; 25 | using EnergyAnalysisForDynamo.DataContracts; 26 | 27 | 28 | namespace EnergyAnalysisForDynamo.Utilities 29 | { 30 | [IsVisibleInDynamoLibrary(false)] 31 | public static class Helper 32 | { 33 | //RevitAuthProvider 34 | private static RevitAuthProvider revitAuthProvider; 35 | 36 | // get surface ids from analytical energy model based on type 37 | public static List GetSurfaceIdsFromMassEnergyAnalyticalModelBasedOnType(MassEnergyAnalyticalModel MassEnergyAnalyticalModel, string SurfaceTypeName = "Mass Exterior Wall") 38 | { 39 | 40 | //get the MassSurfaceData ids of the definitions belonging to external faces 41 | //we'll output these, and then try to visualize the faces and change parameters in another component 42 | 43 | //get references to the faces using the mass - we need these to get at the surface data 44 | IList faceRefs = MassEnergyAnalyticalModel.GetReferencesToAllFaces(); 45 | 46 | //list to collect ids of matching surfaces 47 | List SelectedSurfaceIds = new List(); 48 | 49 | //some faces supposedly share massSurfaceData definitions (although i think they are all unique in practice) - here we're pulling out unique data definitions. 50 | Dictionary mySurfaceData = new Dictionary(); 51 | foreach (var fr in faceRefs) 52 | { 53 | Autodesk.Revit.DB.ElementId id = MassEnergyAnalyticalModel.GetMassSurfaceDataIdForReference(fr); 54 | if (!mySurfaceData.ContainsKey(id.IntegerValue)) 55 | { 56 | MassSurfaceData d = (MassSurfaceData)MassEnergyAnalyticalModel.Document.GetElement(id); 57 | 58 | // add to dictionary to be able to keep track of ids 59 | mySurfaceData.Add(id.IntegerValue, d); 60 | 61 | if (d.Category.Name == SurfaceTypeName) 62 | { 63 | // collect the id 64 | SelectedSurfaceIds.Add(id); 65 | } 66 | } 67 | } 68 | 69 | 70 | List outSelectedSurfaceIds = SelectedSurfaceIds.Select(e => new ElementId(e.IntegerValue)).ToList(); 71 | 72 | return outSelectedSurfaceIds; 73 | } 74 | 75 | // get surface ids from zone based on type 76 | public static List GetSurfaceIdsFromZoneBasedOnType(MassZone MassZone, string SurfaceTypeName = "Mass Exterior Wall") 77 | { 78 | //some faces supposedly share massSurfaceData definitions (although i think they are all unique in practice) - here we're pulling out unique data definitions. 79 | Dictionary mySurfaceData = new Dictionary(); 80 | List SurfaceIds = new List(); 81 | 82 | //get references to all of the faces 83 | IList faceRefs = MassZone.GetReferencesToEnergyAnalysisFaces(); 84 | 85 | foreach (var faceRef in faceRefs) 86 | { 87 | var srfType = faceRef.GetType(); 88 | string refType = faceRef.ElementReferenceType.ToString(); 89 | 90 | //get the element ID of the MassSurfaceData object associated with this face 91 | Autodesk.Revit.DB.ElementId id = MassZone.GetMassDataElementIdForZoneFaceReference(faceRef); 92 | 93 | //add it to our dict if it isn't already there 94 | if (!mySurfaceData.ContainsKey(id.IntegerValue)) 95 | { 96 | Autodesk.Revit.DB.Element mySurface = MassZone.Document.GetElement(id); 97 | //add id and surface to dictionary to keep track of data 98 | mySurfaceData.Add(id.IntegerValue, mySurface); 99 | 100 | if (mySurface.Category.Name == SurfaceTypeName) 101 | { 102 | // collect the id 103 | SurfaceIds.Add(id); 104 | } 105 | 106 | } 107 | } 108 | 109 | //loop over the output lists, and wrap them in our ElementId wrapper class 110 | List outSurfaceIds = SurfaceIds.Select(e => new ElementId(e.IntegerValue)).ToList(); 111 | 112 | return outSurfaceIds; 113 | } 114 | 115 | // GBS Authentification 116 | public static void InitRevitAuthProvider() 117 | { 118 | SingleSignOnManager.RegisterSingleSignOn(); 119 | revitAuthProvider = revitAuthProvider ?? new RevitAuthProvider(SynchronizationContext.Current); 120 | } 121 | 122 | // Check if the Project has been already created 123 | public static bool IsProjectAlreadyExist(string NewProjectName) // true the project is existing, false is a new project 124 | { 125 | bool IsExisting = false; 126 | 127 | // Initiate the Revit Auth 128 | InitRevitAuthProvider(); 129 | 130 | // Request 131 | string requestUri = GBSUri.GBSAPIUri + string.Format(APIV1Uri.GetProjectList, "json"); 132 | 133 | HttpWebResponse response = (HttpWebResponse)_CallGetApi(requestUri); 134 | Stream responseStream = response.GetResponseStream(); 135 | StreamReader reader = new StreamReader(responseStream); 136 | string result = reader.ReadToEnd(); 137 | List projectList = DataContractJsonDeserialize>(result); 138 | 139 | 140 | try 141 | { 142 | var project = (from pr in projectList 143 | where pr.Title == NewProjectName 144 | select pr).First(); 145 | 146 | if (project != null) 147 | { 148 | IsExisting = true; 149 | } 150 | 151 | } 152 | catch (Exception) 153 | { 154 | 155 | } 156 | 157 | return IsExisting; 158 | } 159 | 160 | // Get Existing Projects from GBS 161 | public static List GetExistingProjectsTitles() 162 | { 163 | // Request 164 | string requestUri = GBSUri.GBSAPIUri + string.Format(APIV1Uri.GetProjectList, "json"); 165 | 166 | HttpWebResponse response = (HttpWebResponse)_CallGetApi(requestUri); 167 | Stream responseStream = response.GetResponseStream(); 168 | StreamReader reader = new StreamReader(responseStream); 169 | string result = reader.ReadToEnd(); 170 | List projectList = DataContractJsonDeserialize>(result); 171 | 172 | return projectList; 173 | } 174 | 175 | // Remap Revit Building type to GBS 176 | public static int RemapBldgType(string RvtBldType) 177 | { 178 | int GBSBldgEnum = 1; 179 | 180 | // Initiate the Revit Auth 181 | InitRevitAuthProvider(); 182 | 183 | 184 | // Get Building Types 185 | 186 | // Request 187 | string requestUri = GBSUri.GBSAPIUri + string.Format(APIV1Uri.GetBuildingTypesUri, "json"); 188 | 189 | HttpWebResponse response = (HttpWebResponse)_CallGetApi(requestUri); 190 | Stream responseStream = response.GetResponseStream(); 191 | StreamReader reader = new StreamReader(responseStream); 192 | string result = reader.ReadToEnd(); 193 | 194 | List buildingTypeList = DataContractJsonDeserialize>(result); 195 | 196 | DataContracts.BuildingType bldgType; 197 | 198 | try 199 | { 200 | bldgType = (from BldType in buildingTypeList 201 | where BldType.BuildingTypeName == RvtBldType 202 | select BldType).First(); 203 | } 204 | catch (Exception) 205 | { 206 | throw new Exception("The Building Type is not defined in GBS"); 207 | } 208 | 209 | 210 | if (bldgType != null) 211 | { 212 | GBSBldgEnum = bldgType.BuildingTypeId; 213 | } 214 | 215 | 216 | return GBSBldgEnum; 217 | 218 | } 219 | 220 | //Remap Revit Operating Schedule to GBS __ This is slopy mapping ! 221 | public static int RemapScheduleType(int RvtSchdlType) 222 | { 223 | int gbsSchdlTyp = 1; // default 224 | 225 | if (RvtSchdlType == 0) // Default 226 | { 227 | gbsSchdlTyp = 1; 228 | } 229 | else if (RvtSchdlType == 1) //TwentyFourHourSevenDayFacility 24/7 230 | { 231 | gbsSchdlTyp = 2; 232 | } 233 | else if (RvtSchdlType == 2) // TwentyFourHourSixDayFacility 24/6 234 | { 235 | gbsSchdlTyp = 3; 236 | } 237 | else if (RvtSchdlType == 3) // TwentyFourHourHourFiveDayFacility 24/5 238 | { 239 | gbsSchdlTyp = 4; 240 | } 241 | else if (RvtSchdlType == 4) // TwelveHourSevenDayFacility 12/7 242 | { 243 | gbsSchdlTyp = 5; 244 | } 245 | else if (RvtSchdlType == 5) // TwelveHourSixDayFacility 12/6 246 | { 247 | gbsSchdlTyp = 6; 248 | } 249 | else if (RvtSchdlType == 6) // TwelveHourFiveDayFacility 12/5 250 | { 251 | gbsSchdlTyp = 7; 252 | } 253 | else if (RvtSchdlType == 7) // KindergartenThruTwelveGradeSchool k12 254 | { 255 | gbsSchdlTyp = 8; 256 | } 257 | else if (RvtSchdlType == 8) // YearRoundSchool 258 | { 259 | gbsSchdlTyp = 9; 260 | } 261 | else if (RvtSchdlType == 9) //TheaterPerformingArts 262 | { 263 | gbsSchdlTyp = 10; 264 | } 265 | else if (RvtSchdlType == 10) // Worship 266 | { 267 | gbsSchdlTyp = 11; 268 | } 269 | else if (RvtSchdlType == 11) //NON 270 | { 271 | gbsSchdlTyp = 1; 272 | } 273 | 274 | return gbsSchdlTyp; 275 | 276 | } 277 | 278 | #region API Web Requests 279 | 280 | /// 281 | /// Turn on and off MassRuns in project level 282 | /// 283 | /// 284 | /// 285 | /// 286 | public static void _ExecuteMassRuns(bool Run = true, int ProjectId = 0) 287 | { 288 | // For more information eead this post on Autodesk's blog 289 | // http://autodesk.typepad.com/bpa/2013/05/new-update-on-gbs-adn-api.html 290 | 291 | // Get Uri for updating mass run in project level 292 | // You can control mass run either in project level or in user level. The process is similar but the Uri is different. 293 | // To update massrun is user level look for APIV1Uri.ControlMassRunInUserLevel 294 | string ControlMassRuns = GBSUri.GBSAPIUri + 295 | string.Format(APIV1Uri.ControlMassRunInProjectLevel, ProjectId.ToString()); 296 | 297 | // First Get request is to get the permission 298 | // Sign URL using Revit auth 299 | var MassRunRequestUri = revitAuthProvider.SignRequest(ControlMassRuns, HttpMethod.Get, null); 300 | 301 | // Send the request to GBS 302 | var request = (HttpWebRequest)System.Net.WebRequest.Create(MassRunRequestUri); 303 | request.Timeout = 300000; 304 | request.Method = "GET"; 305 | // request.PreAuthenticate = true; 306 | request.ContentType = "application/xml"; 307 | 308 | // get the response 309 | WebResponse response = request.GetResponse(); 310 | 311 | // read the response 312 | // StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8); 313 | // reader.ReadToEnd(); 314 | 315 | // Now that we have the permission let's change it based on user's request for this project 316 | // Sign URL using Revit auth 317 | var MassRunUpdateUri = revitAuthProvider.SignRequest(ControlMassRuns, HttpMethod.Put, null); 318 | 319 | // Send the request to GBS 320 | var changeRequest = (HttpWebRequest)System.Net.WebRequest.Create(MassRunUpdateUri); 321 | changeRequest.Timeout = 300000; 322 | changeRequest.Method = "PUT"; 323 | changeRequest.PreAuthenticate = true; 324 | changeRequest.ContentType = "application/xml"; 325 | 326 | using (Stream requestStream = changeRequest.GetRequestStream()) 327 | 328 | 329 | using (StreamWriter requestWriter = new StreamWriter(requestStream)) 330 | { 331 | using (MemoryStream ms = new MemoryStream()) 332 | { 333 | DataContractSerializer serializer = new DataContractSerializer((typeof(bool))); 334 | 335 | // Here we set up the parameters 336 | serializer.WriteObject(ms, Run); 337 | 338 | byte[] postData = ms.ToArray(); 339 | requestStream.Write(postData, 0, postData.Length); 340 | 341 | } 342 | } 343 | 344 | // get response 345 | WebResponse changeResponse = changeRequest.GetResponse(); 346 | 347 | // read the response 348 | //using (StreamReader responseReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8)) 349 | //{ 350 | // responseReader.ReadToEnd(); 351 | //} 352 | 353 | } 354 | 355 | 356 | public static WebResponse _CallGetApi(string requestUri) 357 | { 358 | // Sign URL using Revit auth 359 | var signedRequestUri = revitAuthProvider.SignRequest(requestUri, HttpMethod.Get, null); 360 | 361 | // Send request to GBS 362 | System.Net.WebRequest request = System.Net.WebRequest.Create(signedRequestUri); 363 | request.Timeout = 300000; 364 | WebResponse response = request.GetResponse(); 365 | 366 | return response; 367 | } 368 | 369 | public static WebResponse _CallPostApi(string requestUri, System.Type type, object o, int Timeout = 300000) 370 | { 371 | string postString = null; 372 | try 373 | { 374 | var s = new DataContractSerializer(type); 375 | using (MemoryStream stream = new MemoryStream()) 376 | { 377 | s.WriteObject(stream, o); 378 | postString = Encoding.UTF8.GetString(stream.ToArray()); 379 | } 380 | } 381 | catch (Exception) 382 | { 383 | 384 | throw new Exception("The encoding xml failed "); 385 | } 386 | 387 | 388 | // Sign URL using Revit auth 389 | var signedRequestUri = revitAuthProvider.SignRequest(requestUri, HttpMethod.Post, null); 390 | 391 | // Send request to GBS 392 | var request = (HttpWebRequest)System.Net.WebRequest.Create(signedRequestUri); 393 | request.Timeout = Timeout; 394 | request.Method = "POST"; 395 | request.ContentType = "application/xml"; 396 | using (Stream requestStream = request.GetRequestStream()) 397 | using (StreamWriter requestWriter = new StreamWriter(requestStream)) 398 | { 399 | requestWriter.Write(postString); 400 | } 401 | 402 | // get response 403 | WebResponse response = request.GetResponse(); 404 | return response; 405 | } 406 | 407 | #endregion 408 | 409 | #region Serialize/ Deserialize 410 | 411 | public static T DataContractJsonDeserialize(string response) 412 | { 413 | using (MemoryStream stream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(response))) 414 | { 415 | DataContractJsonSerializer serialize = new DataContractJsonSerializer(typeof(T)); 416 | return (T)serialize.ReadObject(stream); 417 | } 418 | } 419 | 420 | public static int DeserializeHttpWebResponse(HttpWebResponse response) 421 | { 422 | var theresponse = ""; 423 | using (Stream responseStream = response.GetResponseStream()) 424 | { 425 | using (var streamReader = new StreamReader(responseStream)) 426 | { 427 | theresponse = streamReader.ReadToEnd(); 428 | } 429 | } 430 | var newId = DataContractDeserialize(theresponse); 431 | return newId; 432 | } 433 | 434 | public static T DataContractDeserialize(string response) 435 | { 436 | using (var stream = new MemoryStream(Encoding.Default.GetBytes(response))) 437 | { 438 | var serialize = new DataContractSerializer(typeof(T)); 439 | return (T)serialize.ReadObject(stream); 440 | } 441 | } 442 | 443 | #endregion 444 | 445 | #region DataContracts Items Methods 446 | public static NewProjectItem _CreateProjectItem(string title, Boolean demo, int bldgTypeId, int scheduleId, double lat, double lon, float electCost, float fuelcost) 447 | { 448 | 449 | var newProject = new NewProjectItem 450 | { 451 | Title = title, 452 | Demo = demo, 453 | BuildingTypeId = bldgTypeId, 454 | ScheduleId = scheduleId, 455 | Latitude = lat, 456 | Longitude = lon, 457 | CultureInfo = "en-US", // TODO : we shoudl get this from Rvt document ? 458 | ElecCost = electCost, 459 | FuelCost = fuelcost 460 | // Elcin: ElectCost, FuelCost, CultureInfo not required if no value should se the default values ! Ask GBS Team! 461 | }; 462 | 463 | return newProject; 464 | } 465 | 466 | public static NewRunItem _GetNewRunItem(int projectId, string gbXmlFullPath) 467 | { 468 | string gbxmlFile = Path.GetFileName(gbXmlFullPath); // with extension 469 | string path = Path.GetDirectoryName(gbXmlFullPath); // folder of xml file located 470 | 471 | // this creates the zip file 472 | ZipUtil.ZipFile(path, gbxmlFile, gbxmlFile + ".zip"); 473 | byte[] fileBuffer = System.IO.File.ReadAllBytes(Path.Combine(path, gbxmlFile + ".zip")); 474 | string gbXml64 = Convert.ToBase64String(fileBuffer); 475 | 476 | var newRun = new NewRunItem 477 | { 478 | Title = Path.GetFileName(gbxmlFile), 479 | ProjectId = projectId, 480 | Base64EncodedGbxml = gbXml64, 481 | UtilityId = string.Empty 482 | }; 483 | 484 | return newRun; 485 | 486 | } 487 | #endregion 488 | } 489 | } 490 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamo/Utilities/SingleSignOnManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Reflection; 7 | using System.Text; 8 | using Autodesk.DesignScript.Runtime; 9 | 10 | 11 | 12 | namespace EnergyAnalysisForDynamo 13 | { 14 | 15 | internal static class SingleSignOnManager 16 | { 17 | /// 18 | /// A reference to the the SSONET assembly to prevent reloading. 19 | /// 20 | private static Assembly singleSignOnAssembly; 21 | 22 | /// 23 | /// Delay loading of the SSONet.dll 24 | /// 25 | /// The SSONet assembly 26 | private static Assembly LoadSSONet() 27 | { 28 | // get the location of RevitAPI assembly. SSONet is in the same directory. 29 | Assembly revitAPIAss = Assembly.GetAssembly(typeof(Autodesk.Revit.DB.XYZ)); 30 | string revitAPIDir = Path.GetDirectoryName(revitAPIAss.Location); 31 | Debug.Assert(revitAPIDir != null, "revitAPIDir != null"); 32 | 33 | //Retrieve the list of referenced assemblies in an array of AssemblyName. 34 | string strTempAssmbPath = Path.Combine(revitAPIDir, "SSONET.dll"); 35 | 36 | //Load the assembly from the specified path. 37 | return Assembly.LoadFrom(strTempAssmbPath); 38 | } 39 | 40 | /// 41 | /// Callback for registering an authentication provider with the package manager 42 | /// 43 | /// The client, to which the provider will be attached 44 | internal static void RegisterSingleSignOn() 45 | { 46 | singleSignOnAssembly = singleSignOnAssembly ?? LoadSSONet(); 47 | } 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamo/Utilities/ZipUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using ICSharpCode.SharpZipLib.Zip; 4 | using ICSharpCode.SharpZipLib.Checksums; 5 | using System.Xml; 6 | using Autodesk.DesignScript.Runtime; 7 | 8 | namespace EnergyAnalysisForDynamo.Utilities 9 | { 10 | [IsVisibleInDynamoLibrary(false)] 11 | public class ZipUtil 12 | { 13 | public static Stream ZipStream(Stream inputStream, string fileName) 14 | { 15 | MemoryStream zipStream = new MemoryStream(); 16 | ZipOutputStream outstream = new ZipOutputStream(zipStream); 17 | 18 | byte[] buffer = new byte[inputStream.Length]; 19 | inputStream.Read(buffer, 0, buffer.Length); 20 | 21 | ZipEntry entry = new ZipEntry(fileName); 22 | outstream.PutNextEntry(entry); 23 | outstream.Write(buffer, 0, buffer.Length); 24 | outstream.Finish(); 25 | zipStream.Position = 0; 26 | return zipStream; 27 | } 28 | 29 | //public static void ZipFile(string path, string file2Zip, string zipFileName, string zip, string bldgType) 30 | public static void ZipFile(string path, string file2Zip, string zipFileName) 31 | { 32 | //MemoryStream ms = InitializeGbxml(path + file2Zip, zip, bldgType) as MemoryStream; 33 | MemoryStream ms = InitializeGbxml(Path.Combine(path , file2Zip)) as MemoryStream; 34 | 35 | string compressedFile =Path.Combine(path, zipFileName); 36 | if (File.Exists(compressedFile)) 37 | { 38 | File.Delete(compressedFile); 39 | } 40 | Crc32 objCrc32 = new Crc32(); 41 | ZipOutputStream strmZipOutputStream = new ZipOutputStream(File.Create(compressedFile)); 42 | strmZipOutputStream.SetLevel(9); 43 | 44 | byte[] gbXmlBuffer = new byte[ms.Length]; 45 | ms.Read(gbXmlBuffer, 0, gbXmlBuffer.Length); 46 | 47 | ZipEntry objZipEntry = new ZipEntry(file2Zip); 48 | 49 | objZipEntry.DateTime = DateTime.Now; 50 | objZipEntry.Size = ms.Length; 51 | ms.Close(); 52 | objCrc32.Reset(); 53 | objCrc32.Update(gbXmlBuffer); 54 | objZipEntry.Crc = objCrc32.Value; 55 | strmZipOutputStream.PutNextEntry(objZipEntry); 56 | strmZipOutputStream.Write(gbXmlBuffer, 0, gbXmlBuffer.Length); 57 | strmZipOutputStream.Finish(); 58 | strmZipOutputStream.Close(); 59 | strmZipOutputStream.Dispose(); 60 | } 61 | 62 | public static string Unzip(string fileNameZip) 63 | { 64 | string path = Path.GetDirectoryName(fileNameZip); 65 | string folderName = Path.Combine(path, Path.GetFileNameWithoutExtension(fileNameZip)); 66 | CreateDirectory(folderName); 67 | 68 | ZipInputStream strmZipInputStream = new ZipInputStream(File.OpenRead(fileNameZip)); 69 | ZipEntry entry; 70 | while ((entry = strmZipInputStream.GetNextEntry()) != null) 71 | { 72 | FileStream fs = File.Create(Path.Combine(folderName, entry.Name)); 73 | int size = 2048; 74 | byte[] data = new byte[2048]; 75 | 76 | while (true) 77 | { 78 | size = strmZipInputStream.Read(data, 0, data.Length); 79 | if (size > 0) 80 | fs.Write(data, 0, size); 81 | else 82 | break; 83 | } 84 | fs.Close(); 85 | } 86 | strmZipInputStream.Close(); 87 | return folderName; 88 | } 89 | 90 | //public static Stream InitializeGbxml(string fullname, string zipCode, string buildingType) 91 | public static Stream InitializeGbxml(string fullname) 92 | { 93 | XmlDocument doc = new XmlDocument(); 94 | doc.Load(fullname); 95 | 96 | // EE: There must be a shorter way ! 97 | XmlNode node = doc.DocumentElement; 98 | foreach (XmlNode node1 in node.ChildNodes) 99 | { 100 | foreach (XmlNode node2 in node1.ChildNodes) 101 | { 102 | if (node2.Name == "ProgramInfo") 103 | { 104 | foreach (XmlNode childnode in node2.ChildNodes) 105 | { 106 | if (childnode.Name == "ProductName") 107 | { 108 | if (!childnode.InnerText.Contains("Dynamo")) 109 | { 110 | string productname = "Dynamo _ " + childnode.InnerText; 111 | childnode.InnerText = productname; 112 | } 113 | } 114 | } 115 | } 116 | } 117 | } 118 | 119 | 120 | XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable); 121 | nsmgr.AddNamespace("gbx", doc.DocumentElement.Attributes["xmlns"].Value); 122 | 123 | 124 | MemoryStream ms = new MemoryStream(); 125 | doc.Save(ms); 126 | ms.Position = 0; 127 | 128 | return ms; 129 | } 130 | 131 | public static void CreateDirectory(string path) 132 | { 133 | if (!Directory.Exists(path)) 134 | Directory.CreateDirectory(path); 135 | } 136 | 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamoTests/EnergyAnalysisForDynamoTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | Debug 9 | AnyCPU 10 | {FFC824C4-08A8-49A1-AA0B-80AAD9913C16} 11 | Library 12 | Properties 13 | EnergyAnalysisForDynamoTests 14 | EnergyAnalysisForDynamoTests 15 | v4.5 16 | 512 17 | 18 | 19 | 20 | true 21 | full 22 | false 23 | $(OutputPath) 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | false 28 | 29 | 30 | pdbonly 31 | true 32 | $(OutputPath) 33 | TRACE 34 | prompt 35 | 4 36 | false 37 | 38 | 39 | 40 | $(DYNAMO_API)\DynamoCore.dll 41 | False 42 | 43 | 44 | False 45 | $(DYNAMO_API)\nunit.framework.dll 46 | False 47 | 48 | 49 | $(REVIT_API)\RevitAPI.dll 50 | False 51 | 52 | 53 | $(REVIT_API)\RevitAPIUI.dll 54 | False 55 | 56 | 57 | $(DYNAMOREVIT_API)\$(REVIT_VERSION)\RevitServices.dll 58 | False 59 | 60 | 61 | $(DYNAMOREVIT_API)\$(REVIT_VERSION)\RevitTestFrameworkTypes.dll 62 | False 63 | 64 | 65 | $(DYNAMOREVIT_API)\$(REVIT_VERSION)\RevitTestServices.dll 66 | False 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | $(DYNAMO_API)\SystemTestServices.dll 77 | False 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | {213d4bb4-4736-48ae-a9b3-4d7bce2e8d39} 87 | EnergyAnalysisForDynamo 88 | False 89 | 90 | 91 | 92 | 99 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamoTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("EnergyAnalysisForDynamoTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("EnergyAnalysisForDynamoTests")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("87600588-2405-4ad9-a458-89c9192bd600")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.2.42")] 36 | [assembly: AssemblyFileVersion("0.2.42")] 37 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamoTests/SystemTests.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Reflection; 3 | using NUnit.Framework; 4 | using RevitTestServices; 5 | using RTF.Framework; 6 | using Autodesk.Revit.DB; 7 | using RevitServices.Persistence; 8 | using Autodesk.Revit.DB.Analysis; 9 | using System.Collections.Generic; 10 | using EnergyAnalysisForDynamo; 11 | 12 | 13 | 14 | namespace EnergyAnalysisForDynamoTests 15 | { 16 | [TestFixture] 17 | public class EnergyAnalysisForDynamo_SystemTesting : RevitSystemTestBase 18 | { 19 | [SetUp] 20 | public void Setup() 21 | { 22 | // Set the working directory. This will allow you to use the OpenAndRunDynamoDefinition method, 23 | // specifying a relative path to the .dyn file you want to test. 24 | 25 | var asmDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 26 | workingDirectory = Path.GetFullPath(Path.Combine(asmDirectory, 27 | @"..\..\..\packages\EnergyAnalysisForDynamo\extra")); 28 | } 29 | 30 | /// 31 | /// Test for Example file 1a. Set the Revit Project's energy settings, and check to make sure the settings were applied. 32 | /// 33 | [Test, TestModel(@".\EnergyAnalysisForDynamo_ex1_simpleRevitMass.rvt")] 34 | public void SetProjectEnergySettings() 35 | { 36 | //open and run the example file 37 | OpenAndRunDynamoDefinition(@".\EnergyAnalysisForDynamo_ex1a_SetProjectEnergySettings.dyn"); 38 | //check for errors and assert accordingly 39 | string errString = CompileErrorsIntoString(); 40 | if (string.IsNullOrEmpty(errString)) 41 | { 42 | Assert.Pass(); 43 | } 44 | else 45 | { 46 | Assert.Fail(errString); 47 | } 48 | 49 | } 50 | 51 | /// 52 | /// Test for Example file 1b. Set some parameters on wall and glazing surfaces in Dynamo, and make sure they were applied in Revit. 53 | /// 54 | [Test, TestModel(@".\EnergyAnalysisForDynamo_ex1_simpleRevitMass.rvt")] 55 | public void SetSurfaceParameters() 56 | { 57 | //open and run the example file 58 | OpenAndRunDynamoDefinition(@".\EnergyAnalysisForDynamo_ex1b_CreateEnergyModelAndSetSurfaceParams.dyn"); 59 | //check for errors and assert accordingly 60 | string errString = CompileErrorsIntoString(); 61 | if (string.IsNullOrEmpty(errString)) 62 | { 63 | Assert.Pass(); 64 | } 65 | else 66 | { 67 | Assert.Fail(errString); 68 | } 69 | 70 | } 71 | 72 | /// 73 | /// Test for Example file 1c. Set some parameters on a zone in Dynamo, and make sure they were applied in Revit. 74 | /// 75 | [Test, TestModel(@".\EnergyAnalysisForDynamo_ex1_simpleRevitMass.rvt")] 76 | public void SetZoneParameters() 77 | { 78 | //open and run the example file 79 | OpenAndRunDynamoDefinition(@".\EnergyAnalysisForDynamo_ex1c_CreateEnergyModelAndSetZoneParams.dyn"); 80 | //check for errors and assert accordingly 81 | string errString = CompileErrorsIntoString(); 82 | if (string.IsNullOrEmpty(errString)) 83 | { 84 | Assert.Pass(); 85 | } 86 | else 87 | { 88 | Assert.Fail(errString); 89 | } 90 | } 91 | 92 | /// 93 | /// Test for Example file 1d. Create a series of iterations to analyze with GBS. 94 | /// 95 | [Test, TestModel(@".\EnergyAnalysisForDynamo_ex1_simpleRevitMass.rvt")] 96 | public void IterativeAnalysis() 97 | { 98 | //open and run the example file 99 | OpenAndRunDynamoDefinition(@".\EnergyAnalysisForDynamo_ex1d_iterativeAnalysisExample.dyn"); 100 | //check for errors and assert accordingly 101 | string errString = CompileErrorsIntoString(); 102 | if (string.IsNullOrEmpty(errString)) 103 | { 104 | Assert.Pass(); 105 | } 106 | else 107 | { 108 | Assert.Fail(errString); 109 | } 110 | } 111 | 112 | /// 113 | /// Test for Example file 1e. Set surface parametes based on their orientation. 114 | /// 115 | [Test, TestModel(@".\EnergyAnalysisForDynamo_ex1_simpleRevitMass.rvt")] 116 | public void SetSurfaceParamsByOrientation() 117 | { 118 | //open and run the example file 119 | OpenAndRunDynamoDefinition(@".\EnergyAnalysisForDynamo_ex1e_SetSurfaceParamsByOrientation.dyn"); 120 | //check for errors and assert accordingly 121 | string errString = CompileErrorsIntoString(); 122 | if (string.IsNullOrEmpty(errString)) 123 | { 124 | Assert.Pass(); 125 | } 126 | else 127 | { 128 | Assert.Fail(errString); 129 | } 130 | } 131 | 132 | /// 133 | /// Test for example 2a. Drive glazing percentages on a bunch of surfaces 134 | /// 135 | [Test, TestModel(@".\EnergyAnalysisForDynamo_ex2_fancyRevitMass.rvt")] 136 | public void DriveGlazingPercentageByOrientation() 137 | { 138 | //open and run the example file 139 | OpenAndRunDynamoDefinition(@".\EnergyAnalysisForDynamo_ex2a_DriveSurfacesByOrientation.dyn"); 140 | //check for errors and assert accordingly 141 | string errString = CompileErrorsIntoString(); 142 | if (string.IsNullOrEmpty(errString)) 143 | { 144 | Assert.Pass(); 145 | } 146 | else 147 | { 148 | Assert.Fail(errString); 149 | } 150 | } 151 | 152 | /// 153 | /// Test for example 3a. Create a GBXML file from a mass 154 | /// 155 | [Test, TestModel(@".\EnergyAnalysisForDynamo_ex3_simpleRevitMassWithFloor.rvt")] 156 | public void CreateGbxmlFromMass() 157 | { 158 | //open and run the example file 159 | OpenAndRunDynamoDefinition(@".\EnergyAnalysisForDynamo_ex3a_CreategbXMLfromMass.dyn"); 160 | //check for errors and assert accordingly 161 | string errString = CompileErrorsIntoString(); 162 | if (string.IsNullOrEmpty(errString)) 163 | { 164 | Assert.Pass(); 165 | } 166 | else 167 | { 168 | Assert.Fail(errString); 169 | } 170 | } 171 | 172 | /// 173 | /// Test for example 3b. Create a GBXML file from zones 174 | /// 175 | [Test, TestModel(@".\EnergyAnalysisForDynamo_ex3_simpleRevitMassWithFloor.rvt")] 176 | public void CreateGbxmlFromZones() 177 | { 178 | //open and run the example file 179 | OpenAndRunDynamoDefinition(@".\EnergyAnalysisForDynamo_ex3b_CreategbXMLfromZones.dyn"); 180 | //check for errors and assert accordingly 181 | string errString = CompileErrorsIntoString(); 182 | if (string.IsNullOrEmpty(errString)) 183 | { 184 | Assert.Pass(); 185 | } 186 | else 187 | { 188 | Assert.Fail(errString); 189 | } 190 | } 191 | 192 | /// 193 | /// Example 4a. Create a new project and get a list of projects 194 | /// 195 | [Test, TestModel(@".\EnergyAnalysisForDynamo_ex1_simpleRevitMass.rvt")] 196 | public void CreateNewGbsProject() 197 | { 198 | //open and run the example file 199 | OpenAndRunDynamoDefinition(@".\EnergyAnalysisForDynamo_ex4a_CreateNewProjectAndGetProjectLists.dyn"); 200 | //check for errors and assert accordingly 201 | string errString = CompileErrorsIntoString(); 202 | if (string.IsNullOrEmpty(errString)) 203 | { 204 | Assert.Pass(); 205 | } 206 | else 207 | { 208 | Assert.Fail(errString); 209 | } 210 | } 211 | 212 | /// 213 | /// Example 4b. Upload gbxml into a new project and create a base run 214 | /// 215 | [Test, TestModel(@".\EnergyAnalysisForDynamo_ex1_simpleRevitMass.rvt")] 216 | public void UploadGbxmlAndCreateBaseRun() 217 | { 218 | //open and run the example file 219 | OpenAndRunDynamoDefinition(@".\EnergyAnalysisForDynamo_ex4b_UploadgbxmlAndCreateBaseRun.dyn"); 220 | //check for errors and assert accordingly 221 | string errString = CompileErrorsIntoString(); 222 | if (string.IsNullOrEmpty(errString)) 223 | { 224 | Assert.Pass(); 225 | } 226 | else 227 | { 228 | Assert.Fail(errString); 229 | } 230 | } 231 | 232 | /// 233 | /// Example 5. Get the results of an analysis 234 | /// 235 | [Test, TestModel(@".\EnergyAnalysisForDynamo_ex1_simpleRevitMass.rvt")] 236 | public void GetRunResults() 237 | { 238 | //open and run the example file 239 | OpenAndRunDynamoDefinition(@".\EnergyAnalysisForDynamo_ex5a_GetRunResultsSummary.dyn"); 240 | //check for errors and assert accordingly 241 | string errString = CompileErrorsIntoString(); 242 | if (string.IsNullOrEmpty(errString)) 243 | { 244 | Assert.Pass(); 245 | } 246 | else 247 | { 248 | Assert.Fail(errString); 249 | } 250 | } 251 | 252 | /// 253 | /// Example 6. Download the detailed results of an analysis 254 | /// 255 | [Test, TestModel(@".\EnergyAnalysisForDynamo_ex1_simpleRevitMass.rvt")] 256 | public void DownloadDetailedResults() 257 | { 258 | //open and run the example file 259 | OpenAndRunDynamoDefinition(@".\EnergyAnalysisForDynamo_ex6_DownloadDetailedResults.dyn"); 260 | 261 | //check for errors and assert accordingly 262 | string errString = CompileErrorsIntoString(); 263 | if (string.IsNullOrEmpty(errString)) 264 | { 265 | Assert.Pass(); 266 | } 267 | else 268 | { 269 | Assert.Fail(errString); 270 | } 271 | 272 | } 273 | 274 | /// 275 | /// A utility function to loop over a sample file and list any nodes in error or warning state. 276 | /// 277 | /// 278 | private string CompileErrorsIntoString() 279 | { 280 | //a string to return 281 | string errors = null; 282 | 283 | //loop over the active collection of nodes. 284 | foreach (var i in AllNodes) 285 | { 286 | if (IsNodeInErrorOrWarningState(i.GUID.ToString())) 287 | { 288 | errors += "The node called '" + i.NickName + "' failed or threw a warning." + System.Environment.NewLine; 289 | } 290 | } 291 | 292 | //return the errors string 293 | return errors; 294 | } 295 | 296 | } 297 | } 298 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamo_UI/EnergyAnalysisForDynamoDropdowns.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using Dynamo.Graph.Nodes; 5 | using CoreNodeModels; 6 | using Dynamo.Utilities; 7 | using Autodesk.Revit.DB; 8 | using Autodesk.Revit.DB.Analysis; 9 | using ProtoCore.AST.AssociativeAST; 10 | 11 | namespace EnergyAnalysisForDynamo_UI 12 | { 13 | 14 | [NodeNameAttribute("Building Type Dropdown")] 15 | [NodeCategoryAttribute("EnergyAnalysisForDynamo.EnergySettings")] 16 | [NodeDescriptionAttribute("Select a building type to use with the GBSforDynamo Energy Settings node.")] 17 | [IsDesignScriptCompatibleAttribute] 18 | public class BuildingTypeDropdown : DSDropDownBase 19 | { 20 | public BuildingTypeDropdown() : base(">") { } 21 | 22 | protected override DSDropDownBase.SelectionState PopulateItemsCore(string currentSelection) 23 | { 24 | //clear items 25 | Items.Clear(); 26 | 27 | //set up the collection 28 | var newItems = new List(); 29 | foreach (var j in Enum.GetValues(new gbXMLBuildingType().GetType())) //PAss in the enum here! 30 | { 31 | newItems.Add(new DynamoDropDownItem(j.ToString(), j.ToString())); 32 | } 33 | Items.AddRange(newItems); 34 | 35 | //set the selected index to 0 36 | SelectedIndex = 0; 37 | return SelectionState.Done; 38 | } 39 | 40 | public override IEnumerable BuildOutputAst(List inputAstNodes) 41 | { 42 | // Build an AST node for the type of object contained in your Items collection. 43 | 44 | var intNode = AstFactory.BuildStringNode((string)Items[SelectedIndex].Item); 45 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode); 46 | 47 | return new List {assign}; 48 | } 49 | 50 | } 51 | 52 | [NodeName("HVAC System Type Dropdown")] 53 | [NodeCategory("EnergyAnalysisForDynamo.EnergySettings")] 54 | [NodeDescription("Select a HVAC System type to use with the GBSforDynamo Energy Settings node.")] 55 | [IsDesignScriptCompatible] 56 | public class HVACtypeDropdown : DSDropDownBase 57 | { 58 | public HVACtypeDropdown() : base(">") { } 59 | 60 | protected override DSDropDownBase.SelectionState PopulateItemsCore(string currentSelection) 61 | { 62 | //clear items 63 | Items.Clear(); 64 | 65 | //set up the collection 66 | var newItems = new List(); 67 | foreach (var j in Enum.GetValues(new gbXMLBuildingHVACSystem().GetType())) //PAss in the enum here! 68 | { 69 | newItems.Add(new DynamoDropDownItem(j.ToString(), j.ToString())); 70 | } 71 | Items.AddRange(newItems); 72 | 73 | //set the selected index to 0 74 | SelectedIndex = 0; 75 | return SelectionState.Done; 76 | } 77 | 78 | public override IEnumerable BuildOutputAst(List inputAstNodes) 79 | { 80 | // Build an AST node for the type of object contained in your Items collection. 81 | 82 | var intNode = AstFactory.BuildStringNode((string)Items[SelectedIndex].Item); 83 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode); 84 | 85 | return new List {assign}; 86 | } 87 | } 88 | 89 | [NodeName("Operating Schedules Dropdown")] 90 | [NodeCategory("EnergyAnalysisForDynamo.EnergySettings")] 91 | [NodeDescription("Select an Operating Schedule to use with the Energy Settings node.")] 92 | [IsDesignScriptCompatible] 93 | public class OperatingSchedulesDropdown : DSDropDownBase 94 | { 95 | public OperatingSchedulesDropdown() : base(">") { } 96 | 97 | protected override DSDropDownBase.SelectionState PopulateItemsCore(string currentSelection) 98 | { 99 | //clear items 100 | Items.Clear(); 101 | 102 | //set up the collection 103 | var newItems = new List(); 104 | foreach (var j in Enum.GetValues(new gbXMLBuildingOperatingSchedule().GetType())) //PAss in the enum here! 105 | { 106 | newItems.Add(new DynamoDropDownItem(j.ToString(), j.ToString())); 107 | } 108 | Items.AddRange(newItems); 109 | 110 | //set the selected index to 0 111 | SelectedIndex = 0; 112 | return SelectionState.Done; 113 | } 114 | 115 | public override IEnumerable BuildOutputAst(List inputAstNodes) 116 | { 117 | // Build an AST node for the type of object contained in your Items collection. 118 | 119 | var intNode = AstFactory.BuildStringNode((string)Items[SelectedIndex].Item); 120 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode); 121 | 122 | return new List {assign}; 123 | } 124 | } 125 | 126 | [NodeName("Conceptual Wall Construction Types Dropdown")] 127 | [NodeCategory("EnergyAnalysisForDynamo.EnergySettings")] 128 | [NodeDescription("Select a Conceptual Construction Type to use with the Set Surface Parameters node.")] 129 | [IsDesignScriptCompatible] 130 | public class ConcWallConstTypeDropdown : DSDropDownBase 131 | { 132 | public ConcWallConstTypeDropdown() : base(">") { } 133 | 134 | protected override DSDropDownBase.SelectionState PopulateItemsCore(string currentSelection) 135 | { 136 | //clear items 137 | Items.Clear(); 138 | 139 | //set up the collection 140 | var newItems = new List(); 141 | foreach (var j in Enum.GetValues(new ConceptualConstructionWallType().GetType())) //PAss in the enum here! 142 | { 143 | newItems.Add(new DynamoDropDownItem(j.ToString(), j.ToString())); 144 | } 145 | Items.AddRange(newItems); 146 | 147 | //set the selected index to 0 148 | SelectedIndex = 0; 149 | return SelectionState.Done; 150 | } 151 | 152 | public override IEnumerable BuildOutputAst(List inputAstNodes) 153 | { 154 | // Build an AST node for the type of object contained in your Items collection. 155 | 156 | var intNode = AstFactory.BuildStringNode((string)Items[SelectedIndex].Item); 157 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode); 158 | 159 | return new List {assign}; 160 | } 161 | } 162 | 163 | [NodeName("Conceptual Glazing Construction Types Dropdown")] 164 | [NodeCategory("EnergyAnalysisForDynamo.EnergySettings")] 165 | [NodeDescription("Select a Conceptual Construction Type to use with the Set Surface Parameters node.")] 166 | [IsDesignScriptCompatible] 167 | public class ConcGlazingConstTypeDropdown : DSDropDownBase 168 | { 169 | public ConcGlazingConstTypeDropdown() : base(">") { } 170 | 171 | protected override DSDropDownBase.SelectionState PopulateItemsCore(string currentSelection) 172 | { 173 | //clear items 174 | Items.Clear(); 175 | 176 | //set up the collection 177 | var newItems = new List(); 178 | foreach (var j in Enum.GetValues(new ConceptualConstructionWindowSkylightType().GetType())) //PAss in the enum here! 179 | { 180 | newItems.Add(new DynamoDropDownItem(j.ToString(), j.ToString())); 181 | } 182 | Items.AddRange(newItems); 183 | 184 | //set the selected index to 0 185 | SelectedIndex = 0; 186 | 187 | return SelectionState.Done; 188 | } 189 | 190 | public override IEnumerable BuildOutputAst(List inputAstNodes) 191 | { 192 | // Build an AST node for the type of object contained in your Items collection. 193 | 194 | var intNode = AstFactory.BuildStringNode((string)Items[SelectedIndex].Item); 195 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode); 196 | 197 | return new List {assign}; 198 | } 199 | } 200 | 201 | [NodeName("Conceptual Floor Construction Types Dropdown")] 202 | [NodeCategory("EnergyAnalysisForDynamo.EnergySettings")] 203 | [NodeDescription("Select a Conceptual Construction Type to use with the Set Surface Parameters node.")] 204 | [IsDesignScriptCompatible] 205 | public class ConcFloorConstTypeDropdown : DSDropDownBase 206 | { 207 | public ConcFloorConstTypeDropdown() : base(">") { } 208 | 209 | protected override DSDropDownBase.SelectionState PopulateItemsCore(string currentSelection) 210 | { 211 | //clear items 212 | Items.Clear(); 213 | 214 | //set up the collection 215 | var newItems = new List(); 216 | foreach (var j in Enum.GetValues(new ConceptualConstructionFloorSlabType().GetType())) //PAss in the enum here! 217 | { 218 | newItems.Add(new DynamoDropDownItem(j.ToString(), j.ToString())); 219 | } 220 | Items.AddRange(newItems); 221 | 222 | //set the selected index to 0 223 | SelectedIndex = 0; 224 | return SelectionState.Done; 225 | } 226 | 227 | public override IEnumerable BuildOutputAst(List inputAstNodes) 228 | { 229 | // Build an AST node for the type of object contained in your Items collection. 230 | 231 | var intNode = AstFactory.BuildStringNode((string)Items[SelectedIndex].Item); 232 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode); 233 | 234 | return new List {assign}; 235 | } 236 | } 237 | 238 | [NodeName("Conceptual Roof Construction Types Dropdown")] 239 | [NodeCategory("EnergyAnalysisForDynamo.EnergySettings")] 240 | [NodeDescription("Select a Conceptual Construction Type to use with the Set Surface Parameters node.")] 241 | [IsDesignScriptCompatible] 242 | public class ConcRoofConstTypeDropdown : DSDropDownBase 243 | { 244 | public ConcRoofConstTypeDropdown() : base(">") { } 245 | 246 | protected override DSDropDownBase.SelectionState PopulateItemsCore(string currentSelection) 247 | { 248 | //clear items 249 | Items.Clear(); 250 | 251 | //set up the collection 252 | var newItems = new List(); 253 | foreach (var j in Enum.GetValues(new ConceptualConstructionRoofType().GetType())) //PAss in the enum here! 254 | { 255 | newItems.Add(new DynamoDropDownItem(j.ToString(), j.ToString())); 256 | } 257 | Items.AddRange(newItems); 258 | 259 | //set the selected index to 0 260 | SelectedIndex = 0; 261 | return SelectionState.Done; 262 | } 263 | 264 | public override IEnumerable BuildOutputAst(List inputAstNodes) 265 | { 266 | // Build an AST node for the type of object contained in your Items collection. 267 | 268 | var intNode = AstFactory.BuildStringNode((string)Items[SelectedIndex].Item); 269 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode); 270 | 271 | return new List {assign}; 272 | } 273 | } 274 | 275 | [NodeName("Space Types Dropdown")] 276 | [NodeCategory("EnergyAnalysisForDynamo.EnergySettings")] 277 | [NodeDescription("Select a Space Type to use with the Set Zone Parameters node.")] 278 | [IsDesignScriptCompatible] 279 | public class SpaceTypeDropdown : DSDropDownBase 280 | { 281 | public SpaceTypeDropdown() : base(">") { } 282 | 283 | protected override DSDropDownBase.SelectionState PopulateItemsCore(string currentSelection) 284 | { 285 | //clear items 286 | Items.Clear(); 287 | 288 | //set up the collection 289 | var newItems = new List(); 290 | foreach (var j in Enum.GetValues(new gbXMLSpaceType().GetType())) //PAss in the enum here! 291 | { 292 | newItems.Add(new DynamoDropDownItem(j.ToString(), j.ToString())); 293 | } 294 | Items.AddRange(newItems); 295 | 296 | //set the selected index to 0 297 | SelectedIndex = 0; 298 | return SelectionState.Done; 299 | } 300 | 301 | public override IEnumerable BuildOutputAst(List inputAstNodes) 302 | { 303 | // Build an AST node for the type of object contained in your Items collection. 304 | 305 | var intNode = AstFactory.BuildStringNode((string)Items[SelectedIndex].Item); 306 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode); 307 | 308 | return new List {assign}; 309 | } 310 | } 311 | 312 | [NodeName("Condition Types Dropdown")] 313 | [NodeCategory("EnergyAnalysisForDynamo.EnergySettings")] 314 | [NodeDescription("Select a Condition Type to use with the Zone Parameters node.")] 315 | [IsDesignScriptCompatible] 316 | public class ConditionType : DSDropDownBase 317 | { 318 | public ConditionType() : base(">") { } 319 | 320 | protected override DSDropDownBase.SelectionState PopulateItemsCore(string currentSelection) 321 | { 322 | //clear items 323 | Items.Clear(); 324 | 325 | //set up the collection 326 | var newItems = new List(); 327 | foreach (var j in Enum.GetValues(new gbXMLConditionType().GetType())) //PAss in the enum here! 328 | { 329 | newItems.Add(new DynamoDropDownItem(j.ToString(), j.ToString())); 330 | } 331 | Items.AddRange(newItems); 332 | 333 | //set the selected index to 0 334 | SelectedIndex = 0; 335 | return SelectionState.Done; 336 | } 337 | 338 | public override IEnumerable BuildOutputAst(List inputAstNodes) 339 | { 340 | // Build an AST node for the type of object contained in your Items collection. 341 | 342 | var intNode = AstFactory.BuildStringNode((string)Items[SelectedIndex].Item); 343 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode); 344 | 345 | return new List {assign}; 346 | } 347 | } 348 | 349 | [NodeName("Energy Data File Types Dropdown")] 350 | [NodeCategory("EnergyAnalysisForDynamo.GetAnalysisResults")] 351 | [NodeDescription("Select a Energy Data Type to use with Get Energy Model Files Node.")] 352 | [IsDesignScriptCompatible] 353 | public class EnergyDataFileTypes : DSDropDownBase 354 | { 355 | public EnergyDataFileTypes() : base(">") { } 356 | 357 | protected override DSDropDownBase.SelectionState PopulateItemsCore(string currentSelection) 358 | { 359 | //clear items 360 | Items.Clear(); 361 | 362 | //set up the collection 363 | var newItems = new List(); 364 | foreach (var j in Enum.GetValues(new EnergyDataFileType().GetType())) //PAss in the enum here! 365 | { 366 | newItems.Add(new DynamoDropDownItem(j.ToString(), j.ToString())); 367 | } 368 | Items.AddRange(newItems); 369 | 370 | //set the selected index to 0 371 | SelectedIndex = 0; 372 | return SelectionState.Done; 373 | } 374 | 375 | public override IEnumerable BuildOutputAst(List inputAstNodes) 376 | { 377 | // Build an AST node for the type of object contained in your Items collection. 378 | 379 | var intNode = AstFactory.BuildStringNode((string)Items[SelectedIndex].Item); 380 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode); 381 | 382 | return new List {assign}; 383 | } 384 | } 385 | 386 | public enum EnergyDataFileType 387 | { 388 | gbXML, 389 | doe2, 390 | eplus 391 | } 392 | } 393 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamo_UI/EnergyAnalysisForDynamo_UI.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Debug 8 | AnyCPU 9 | 8.0.30703 10 | 2.0 11 | {8576F024-8D64-4F83-95A8-623D437AF502} 12 | Library 13 | Properties 14 | EnergyAnalysisForDynamo_UI 15 | EnergyAnalysisForDynamo_UI 16 | v4.5 17 | 512 18 | 19 | 20 | 21 | true 22 | full 23 | false 24 | $(OutputPath) 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | false 29 | 30 | 31 | pdbonly 32 | true 33 | $(OutputPath) 34 | TRACE 35 | prompt 36 | 4 37 | false 38 | 39 | 40 | 41 | $(DYNAMO_API)\nodes\CoreNodeModels.dll 42 | False 43 | 44 | 45 | $(DYNAMO_API)\DynamoCore.dll 46 | False 47 | 48 | 49 | $(DYNAMO_API)\DynamoUtilities.dll 50 | False 51 | 52 | 53 | $(DYNAMO_API)\ProtoCore.dll 54 | False 55 | 56 | 57 | False 58 | ..\..\..\..\..\..\..\Program Files\Autodesk\Revit 2015\RevitAPI.dll 59 | False 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 76 | -------------------------------------------------------------------------------- /src/EnergyAnalysisForDynamo_UI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("EnergyAnalysisForDynamo_UI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Thornton Tomasetti, Inc.")] 12 | [assembly: AssemblyProduct("EnergyAnalysisForDynamo_UI")] 13 | [assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("408e94f5-4e41-48d3-a1a5-cc2e7b4d8935")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.2.42")] 36 | [assembly: AssemblyFileVersion("0.2.42")] 37 | -------------------------------------------------------------------------------- /src/StartEnergyAnalysisForDynamo_Debug.bat: -------------------------------------------------------------------------------- 1 | set DYNAMO_API=C:\Program Files\Dynamo 0.9 2 | set REVIT_API=C:\Program Files\Autodesk\Revit 2015 3 | set REVIT_VERSION=Revit_2015 4 | "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" "EnergyAnalysisForDynamo.sln" -------------------------------------------------------------------------------- /src/TestServices.dll.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/config/CS.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10.0 5 | $(SolutionDir)..\bin\$(Platform)\$(Configuration) 6 | $(SolutionDir)..\extern\NUnit 7 | C:\Program Files\Autodesk\Revit 2015 8 | C:\Program Files\Dynamo\Dynamo Core\1.1 9 | C:\Program Files\Dynamo\Dynamo Revit\1.1 10 | Revit_2015 11 | $(OutputPath)\int\ 12 | true 13 | full 14 | false 15 | DEBUG;TRACE 16 | prompt 17 | 4 18 | 19 | 20 | 10.0 21 | $(SolutionDir)..\bin\$(Platform)\$(Configuration) 22 | $(SolutionDir)..\extern\NUnit 23 | C:\Program Files\Autodesk\Revit 2015 24 | C:\Program Files\Dynamo\Dynamo Core\1.1 25 | C:\Program Files\Dynamo\Dynamo Revit\1.1 26 | Revit_2015 27 | $(OutputPath)\int\ 28 | pdbonly 29 | true 30 | TRACE 31 | prompt 32 | 4 33 | 34 | -------------------------------------------------------------------------------- /src/packages/EnergyAnalysisforDynamoAuthHelper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/EnergyAnalysisForDynamo/ae855b60f47e8e08d112e7fdf09d72337bfc02d5/src/packages/EnergyAnalysisforDynamoAuthHelper.dll -------------------------------------------------------------------------------- /src/packages/ICSharpCode.SharpZipLib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/EnergyAnalysisForDynamo/ae855b60f47e8e08d112e7fdf09d72337bfc02d5/src/packages/ICSharpCode.SharpZipLib.dll -------------------------------------------------------------------------------- /src/packages/README.txt: -------------------------------------------------------------------------------- 1 | 3rd party DLLs that are referenced into our project should live here. Since Git won't track them (because of our .gitigore) the developer needs to be sure she has these on her machine. --------------------------------------------------------------------------------