Skip to content

Commit

Permalink
fix(openstudio): Correct OpenStudio version in the event that ladybug…
Browse files Browse the repository at this point in the history
…_tools folder is used

Since @MingboPeng isn't writing the version into the openstudio directory into the exe installer, there's no way to know the version for sure. So I'm just hard-setting it to version 3.0 and let's just hope that we never need to release the legacy executable installer with a later version of Openstudio.
  • Loading branch information
chriswmackey committed Aug 11, 2020
1 parent 4868cd6 commit 3bbc3a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Honeybee_Export To OpenStudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

ghenv.Component.Name = "Honeybee_Export To OpenStudio"
ghenv.Component.NickName = 'exportToOpenStudio'
ghenv.Component.Message = 'VER 0.0.66\nJUL_12_2020'
ghenv.Component.Message = 'VER 0.0.66\nAUG_11_2020'
ghenv.Component.IconDisplayMode = ghenv.Component.IconDisplayMode.application
ghenv.Component.Category = "HB-Legacy"
ghenv.Component.SubCategory = "10 | Energy | Energy"
Expand Down Expand Up @@ -114,11 +114,14 @@
osVersion = openStudioLibFolder.split('-')[-1].split('/')[0]
except:
pass
try:
vernum1, vernum2 = int(osVersion.split('.')[0]), int(osVersion.split('.')[1])
except:
vernum1 = 1
vernum2 = 0
if 'ladybug_tools_legacy' in osVersion:
vernum1, vernum2 = 3, 0
else:
try:
vernum1, vernum2 = int(osVersion.split('.')[0]), int(osVersion.split('.')[1])
except:
vernum1 = 1
vernum2 = 0

import clr
clr.AddReferenceToFileAndPath(openStudioLibFolder+"\\openStudio.dll")
Expand Down
Binary file modified userObjects/Honeybee_Export To OpenStudio.ghuser
Binary file not shown.

0 comments on commit 3bbc3a9

Please sign in to comment.