├── .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