Skip to content

Commit

Permalink
fix(create): Ensure the check for Story heights still happens
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Oct 30, 2024
1 parent b632770 commit 911e948
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
Binary file modified dragonfly_grasshopper/icon/DF Story.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions dragonfly_grasshopper/json/DF_Story.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.8.0",
"version": "1.8.1",
"nickname": "Story",
"outputs": [
[
Expand Down Expand Up @@ -57,7 +57,7 @@
}
],
"subcategory": "0 :: Create",
"code": "\n\ntry: # import the core honeybee dependencies\n from honeybee.typing import clean_and_id_string, clean_string\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the core dragonfly dependencies\n from dragonfly.story import Story\nexcept ImportError as e:\n raise ImportError('\\nFailed to import dragonfly:\\n\\t{}'.format(e))\n\ntry: # import the core ladybug_{{cad}} dependencies\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs, document_counter\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\ntry: # import the dragonfly-energy extension\n import dragonfly_energy\n from honeybee_energy.lib.constructionsets import construction_set_by_identifier\nexcept ImportError as e:\n if _constr_set_ is not None:\n raise ValueError('_constr_set_ has been specified but dragonfly-energy '\n 'has failed to import.\\n{}'.format(e))\n\n\nif all_required_inputs(ghenv.Component):\n # duplicate the initial objects\n room2ds = [room.duplicate() for room in _room2ds]\n\n # generate a default name\n if _name_ is None: # get a default Story name\n display_name = 'Story_{}'.format(document_counter('story_count'))\n name = clean_and_id_string(display_name)\n else:\n display_name = _name_\n name = clean_string(display_name)\n\n # set other defaults\n multiplier_ = multiplier_ if multiplier_ is not None else 1\n\n # create the Story\n story = Story(name, room2ds, _flr_to_flr_, _flr_height_, multiplier_)\n story.display_name = display_name\n\n # assign the construction set\n if _constr_set_ is not None:\n if isinstance(_constr_set_, str):\n _constr_set_ = construction_set_by_identifier(_constr_set_)\n story.properties.energy.construction_set = _constr_set_",
"code": "\n\ntry: # import the core honeybee dependencies\n from honeybee.typing import clean_and_id_string, clean_string\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the core dragonfly dependencies\n from dragonfly.story import Story\nexcept ImportError as e:\n raise ImportError('\\nFailed to import dragonfly:\\n\\t{}'.format(e))\n\ntry: # import the core ladybug_{{cad}} dependencies\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs, document_counter\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\ntry: # import the dragonfly-energy extension\n import dragonfly_energy\n from honeybee_energy.lib.constructionsets import construction_set_by_identifier\nexcept ImportError as e:\n if _constr_set_ is not None:\n raise ValueError('_constr_set_ has been specified but dragonfly-energy '\n 'has failed to import.\\n{}'.format(e))\n\n\nif all_required_inputs(ghenv.Component):\n # duplicate the initial objects\n room2ds = [room.duplicate() for room in _room2ds]\n\n # generate a default name\n if _name_ is None: # get a default Story name\n display_name = 'Story_{}'.format(document_counter('story_count'))\n name = clean_and_id_string(display_name)\n else:\n display_name = _name_\n name = clean_string(display_name)\n\n # set other defaults\n multiplier_ = multiplier_ if multiplier_ is not None else 1\n\n # create the Story\n story = Story(name, room2ds, _flr_to_flr_, _flr_height_, multiplier_)\n story.display_name = display_name\n story.check_room2d_floor_heights_valid()\n\n # assign the construction set\n if _constr_set_ is not None:\n if isinstance(_constr_set_, str):\n _constr_set_ = construction_set_by_identifier(_constr_set_)\n story.properties.energy.construction_set = _constr_set_",
"category": "Dragonfly",
"name": "DF Story",
"description": "Create a Dragonfly Story from individual Dragonfly Room2D objects.\n-"
Expand Down
3 changes: 2 additions & 1 deletion dragonfly_grasshopper/src/DF Story.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

ghenv.Component.Name = 'DF Story'
ghenv.Component.NickName = 'Story'
ghenv.Component.Message = '1.8.0'
ghenv.Component.Message = '1.8.1'
ghenv.Component.Category = 'Dragonfly'
ghenv.Component.SubCategory = '0 :: Create'
ghenv.Component.AdditionalHelpFromDocStrings = '3'
Expand Down Expand Up @@ -90,6 +90,7 @@
# create the Story
story = Story(name, room2ds, _flr_to_flr_, _flr_height_, multiplier_)
story.display_name = display_name
story.check_room2d_floor_heights_valid()

# assign the construction set
if _constr_set_ is not None:
Expand Down
Binary file modified dragonfly_grasshopper/user_objects/DF Story.ghuser
Binary file not shown.

0 comments on commit 911e948

Please sign in to comment.