Skip to content

Commit

Permalink
fix(to_honeybee): Correct the to_honeybee methods to expose add_plenum
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Jun 27, 2020
1 parent 55f60ed commit 5a4837d
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 9 deletions.
16 changes: 12 additions & 4 deletions dragonfly_grasshopper/src/DF Model To Honeybee.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@
simulation will be run once for each unique room and then results
will be multiplied. If False, full geometry objects will be written
for each and every story in the building such that all resulting
multipliers will be 1. Default: True.
multipliers will be 1. (Default: True).
add_plenum_: Boolean to indicate whether ceiling/floor plenums should
be auto-generated for the Rooms. The height of ceiling plenums
will be autocalculated as the difference between the Room2D
ceiling height and Story ceiling height. The height of the floor
plenum will be autocalculated as the difference between the Room2D
floor height and Story floor height. (Default: False).
shade_dist_: An optional number to note the distance beyond which other
buildings' shade should not be exported into a given Model. This is
helpful for reducing the simulation run time of each Model when other
Expand All @@ -49,7 +55,7 @@

ghenv.Component.Name = 'DF Model To Honeybee'
ghenv.Component.NickName = 'ToHoneybee'
ghenv.Component.Message = '0.1.2'
ghenv.Component.Message = '0.2.0'
ghenv.Component.Category = 'Dragonfly'
ghenv.Component.SubCategory = '2 :: Serialize'
ghenv.Component.AdditionalHelpFromDocStrings = '3'
Expand All @@ -71,12 +77,14 @@
if all_required_inputs(ghenv.Component) and _run:
# set default inputs if not specified
use_multiplier_ = use_multiplier_ if use_multiplier_ is not None else True
add_plenum_ = add_plenum_ if add_plenum_ is not None else False
_obj_per_model_ = 'Building' if _obj_per_model_ is None else _obj_per_model_

# check the _model input
assert isinstance(_model, Model), \
'Expected Dragonfly Model object. Got {}.'.format(type(_model))

# create the model objects
hb_models = _model.to_honeybee(_obj_per_model_, shade_dist_,
use_multiplier_, tolerance)
hb_models = _model.to_honeybee(
_obj_per_model_, shade_dist_, use_multiplier_, add_plenum_,
tolerance=tolerance)
13 changes: 10 additions & 3 deletions dragonfly_grasshopper/src/DF Model To geoJSON.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
will be multiplied. If False, full geometry objects will be written
for each and every story in the building such that all resulting
multipliers will be 1. Default: True.
add_plenum_: Boolean to indicate whether ceiling/floor plenums should
be auto-generated for the Rooms. The height of ceiling plenums
will be autocalculated as the difference between the Room2D
ceiling height and Story ceiling height. The height of the floor
plenum will be autocalculated as the difference between the Room2D
floor height and Story floor height. (Default: False).
shade_dist_: An optional number to note the distance beyond which other
buildings' shade should not be exported into a given Model. This is
helpful for reducing the simulation run time of each Model when other
Expand Down Expand Up @@ -59,7 +65,7 @@

ghenv.Component.Name = 'DF Model To geoJSON'
ghenv.Component.NickName = 'ToGeoJSON'
ghenv.Component.Message = '0.1.1'
ghenv.Component.Message = '0.2.0'
ghenv.Component.Category = 'Dragonfly'
ghenv.Component.SubCategory = '2 :: Serialize'
ghenv.Component.AdditionalHelpFromDocStrings = '3'
Expand Down Expand Up @@ -92,6 +98,7 @@
# set default inputs if not specified
point = to_point2d(_point_) if _point_ is not None else Point2D(0, 0)
use_multiplier_ = use_multiplier_ if use_multiplier_ is not None else True
add_plenum_ = add_plenum_ if add_plenum_ is not None else False

# check the _model and _location input
assert isinstance(_model, Model), \
Expand All @@ -104,5 +111,5 @@
else:
# create the geoJSON and honeybee Model JSONs
geojson, hb_jsons, hb_models = _model.to.urbanopt(
_model, _location, point, shade_dist_, use_multiplier_, _folder_,
tolerance)
_model, _location, point, shade_dist_, use_multiplier_, add_plenum_,
_folder_, tolerance=tolerance)
8 changes: 6 additions & 2 deletions dragonfly_grasshopper/src/DF Story.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
this Story to the floor of the story above this one (if it exists).
If None, this value will be the maximum floor_to_ceiling_height of the
input _room_2ds.
_flr_height_: A number for the absolute floor height of the Story.
If None, this will be the minimum floor height of all the Story's
room_2ds, which is suitable for cases where there are no floor
plenums. (Default: None).
_name_: Text to set the name for the Story, which will also be incorporated
into unique Story identifier. If the name is not provided a random
one will be assigned.
Expand All @@ -38,7 +42,7 @@

ghenv.Component.Name = "DF Story"
ghenv.Component.NickName = 'Story'
ghenv.Component.Message = '0.1.3'
ghenv.Component.Message = '0.2.0'
ghenv.Component.Category = "Dragonfly"
ghenv.Component.SubCategory = '0 :: Create'
ghenv.Component.AdditionalHelpFromDocStrings = "3"
Expand Down Expand Up @@ -84,7 +88,7 @@
multiplier_ = multiplier_ if multiplier_ is not None else 1

# create the Story
story = Story(name, room2ds, _flr_to_flr_, multiplier_)
story = Story(name, room2ds, _flr_to_flr_, _flr_height_, multiplier_)
if _name_ is not None:
story.display_name = _name_

Expand Down
Binary file modified dragonfly_grasshopper/user_objects/DF Model To Honeybee.ghuser
Binary file not shown.
Binary file modified dragonfly_grasshopper/user_objects/DF Model To geoJSON.ghuser
Binary file not shown.
Binary file modified dragonfly_grasshopper/user_objects/DF Story.ghuser
Binary file not shown.
Binary file modified samples/from_building_footprints.gh
Binary file not shown.
Binary file modified samples/from_building_solids.gh
Binary file not shown.
Binary file modified samples/load_sharing_example.gh
Binary file not shown.
Binary file modified samples/peak_load_example.gh
Binary file not shown.
Binary file modified samples/rooms_to_stories_to_building.gh
Binary file not shown.

0 comments on commit 5a4837d

Please sign in to comment.