diff --git a/honeybee_grasshopper_radiance/icon/HB Apply Face Modifier.png b/honeybee_grasshopper_radiance/icon/HB Apply Face Modifier.png index fc0f7a0..a0b3fd8 100644 Binary files a/honeybee_grasshopper_radiance/icon/HB Apply Face Modifier.png and b/honeybee_grasshopper_radiance/icon/HB Apply Face Modifier.png differ diff --git a/honeybee_grasshopper_radiance/icon/HB Apply ModifierSet.png b/honeybee_grasshopper_radiance/icon/HB Apply ModifierSet.png index 5626fa5..573609a 100644 Binary files a/honeybee_grasshopper_radiance/icon/HB Apply ModifierSet.png and b/honeybee_grasshopper_radiance/icon/HB Apply ModifierSet.png differ diff --git a/honeybee_grasshopper_radiance/icon/HB Apply Shade Modifier.png b/honeybee_grasshopper_radiance/icon/HB Apply Shade Modifier.png index 3a01d8b..9f8156f 100644 Binary files a/honeybee_grasshopper_radiance/icon/HB Apply Shade Modifier.png and b/honeybee_grasshopper_radiance/icon/HB Apply Shade Modifier.png differ diff --git a/honeybee_grasshopper_radiance/icon/HB Apply Window Modifier.png b/honeybee_grasshopper_radiance/icon/HB Apply Window Modifier.png index e95fa3a..6c39704 100644 Binary files a/honeybee_grasshopper_radiance/icon/HB Apply Window Modifier.png and b/honeybee_grasshopper_radiance/icon/HB Apply Window Modifier.png differ diff --git a/honeybee_grasshopper_radiance/json/HB_Apply_Face_Modifier.json b/honeybee_grasshopper_radiance/json/HB_Apply_Face_Modifier.json index f490fbf..8bdd8f9 100644 --- a/honeybee_grasshopper_radiance/json/HB_Apply_Face_Modifier.json +++ b/honeybee_grasshopper_radiance/json/HB_Apply_Face_Modifier.json @@ -1,5 +1,5 @@ { - "version": "1.6.0", + "version": "1.6.1", "nickname": "ApplyFaceMod", "outputs": [ [ @@ -16,7 +16,7 @@ { "access": "list", "name": "_hb_objs", - "description": "Honeybee Faces, Doors or Rooms to which the input _mod should\nbe assigned. For the case of a Honeybee Room, the modifier\nwill only be applied to the Room's outdoor walls. Note that, if you\nneed to assign a modifier to all the roofs, floors, etc. of a\nRoom, the best practice is to create a ModifierSet and assing that\nto the Room.", + "description": "Honeybee Faces, Doors, Rooms or a Model to which the input _mod should\nbe assigned. For the case of Rooms or a Model, the modifier\nwill only be applied to the Room's outdoor walls. Note that, if you\nneed to assign a modifier to all the roofs, floors, etc. of a\nRoom, the best practice is to create a ModifierSet and assing that\nto the Room.", "type": "System.Object", "default": null }, @@ -29,7 +29,7 @@ } ], "subcategory": "1 :: Modifiers", - "code": "\n\ntry: # import the honeybee-radiance extension\n from honeybee_radiance.lib.modifiers import modifier_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_radiance:\\n\\t{}'.format(e))\n\ntry: # import the core honeybee dependencies\n from honeybee.boundarycondition import Outdoors\n from honeybee.facetype import Wall\n from honeybee.room import Room\n from honeybee.face import Face\n from honeybee.door import Door\n from honeybee.orientation import angles_from_num_orient, face_orient_index\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the ladybug_{{cad}} dependencies\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\ndef is_exterior_wall(face):\n \"\"\"Check whether a given Face is an exterior Wall.\"\"\"\n return isinstance(face.boundary_condition, Outdoors) and \\\n isinstance(face.type, Wall)\n\n\nif all_required_inputs(ghenv.Component):\n # duplicate the initial objects\n hb_objs = [obj.duplicate() for obj in _hb_objs]\n\n # process the input modifiers\n for i, constr in enumerate(_mod):\n if isinstance(constr, str):\n _mod[i] = modifier_by_identifier(constr)\n\n # error message for unrecognized object\n error_msg = 'Input _hb_objs must be a Room, Face, or Door. Not {}.'\n\n # assign the modifiers\n if len(_mod) == 1: # assign indiscriminately, even if it's horizontal\n for obj in hb_objs:\n if isinstance(obj, (Face, Door)):\n obj.properties.radiance.modifier = _mod[0]\n elif isinstance(obj, Room):\n for face in obj.faces:\n if is_exterior_wall(face):\n face.properties.radiance.modifier = _mod[0]\n else:\n raise TypeError(error_msg.format(type(obj)))\n else: # assign modifiers based on cardinal direction\n angles = angles_from_num_orient(len(_mod))\n for obj in hb_objs:\n if isinstance(obj, (Face, Door)):\n orient_i = face_orient_index(obj, angles)\n if orient_i is not None:\n obj.properties.radiance.modifier = _mod[orient_i]\n elif isinstance(obj, Room):\n for face in obj.faces:\n if is_exterior_wall(face):\n orient_i = face_orient_index(face, angles)\n if orient_i is not None:\n face.properties.radiance.modifier = _mod[orient_i]\n else:\n raise TypeError(error_msg.format(type(obj)))\n", + "code": "\n\ntry: # import the honeybee-radiance extension\n from honeybee_radiance.lib.modifiers import modifier_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_radiance:\\n\\t{}'.format(e))\n\ntry: # import the core honeybee dependencies\n from honeybee.boundarycondition import Outdoors\n from honeybee.facetype import Wall\n from honeybee.model import Model\n from honeybee.room import Room\n from honeybee.face import Face\n from honeybee.door import Door\n from honeybee.orientation import angles_from_num_orient, face_orient_index\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the ladybug_{{cad}} dependencies\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\ndef is_exterior_wall(face):\n \"\"\"Check whether a given Face is an exterior Wall.\"\"\"\n return isinstance(face.boundary_condition, Outdoors) and \\\n isinstance(face.type, Wall)\n\n\nif all_required_inputs(ghenv.Component):\n # duplicate the initial objects\n hb_objs = [obj.duplicate() for obj in _hb_objs]\n\n # process the input modifiers\n for i, constr in enumerate(_mod):\n if isinstance(constr, str):\n _mod[i] = modifier_by_identifier(constr)\n\n # error message for unrecognized object\n error_msg = 'Input _hb_objs must be a Room, Face, or Door. Not {}.'\n\n # assign the modifiers\n if len(_mod) == 1: # assign indiscriminately, even if it's horizontal\n for obj in hb_objs:\n if isinstance(obj, (Face, Door)):\n obj.properties.radiance.modifier = _mod[0]\n elif isinstance(obj, (Room, Model)):\n for face in obj.faces:\n if is_exterior_wall(face):\n face.properties.radiance.modifier = _mod[0]\n else:\n raise TypeError(error_msg.format(type(obj)))\n else: # assign modifiers based on cardinal direction\n angles = angles_from_num_orient(len(_mod))\n for obj in hb_objs:\n if isinstance(obj, (Face, Door)):\n orient_i = face_orient_index(obj, angles)\n if orient_i is not None:\n obj.properties.radiance.modifier = _mod[orient_i]\n elif isinstance(obj, (Room, Model)):\n for face in obj.faces:\n if is_exterior_wall(face):\n orient_i = face_orient_index(face, angles)\n if orient_i is not None:\n face.properties.radiance.modifier = _mod[orient_i]\n else:\n raise TypeError(error_msg.format(type(obj)))\n", "category": "HB-Radiance", "name": "HB Apply Face Modifier", "description": "Apply a Modifier to Honeybee Faces, Doors or Room walls.\n_\nThis component supports the assigning of different modifiers based on cardinal\norientation, provided that a list of Modifiers are input to the _mod. \n-" diff --git a/honeybee_grasshopper_radiance/json/HB_Apply_ModifierSet.json b/honeybee_grasshopper_radiance/json/HB_Apply_ModifierSet.json index 98e133d..6dd5589 100644 --- a/honeybee_grasshopper_radiance/json/HB_Apply_ModifierSet.json +++ b/honeybee_grasshopper_radiance/json/HB_Apply_ModifierSet.json @@ -1,5 +1,5 @@ { - "version": "1.6.0", + "version": "1.6.1", "nickname": "ApplyModSet", "outputs": [ [ @@ -16,7 +16,7 @@ { "access": "list", "name": "_rooms", - "description": "Honeybee Rooms to which the input _mod_set should be assigned.", + "description": "Honeybee Rooms to which the input _mod_set should be assigned.\nThis can also be a Honeybee Model for which all Rooms\nwill be assigned the ModifierSet.", "type": "System.Object", "default": null }, @@ -29,7 +29,7 @@ } ], "subcategory": "1 :: Modifiers", - "code": "\n\ntry: # import the honeybee-radiance extension\n from honeybee_radiance.lib.modifiersets import modifier_set_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_radiance:\\n\\t{}'.format(e))\n\ntry: # import the ladybug_{{cad}} dependencies\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\nif all_required_inputs(ghenv.Component):\n # duplicate the initial objects\n rooms = [obj.duplicate() for obj in _rooms]\n\n # process the input modifier set if it's a string\n if isinstance(_mod_set, str):\n _mod_set = modifier_set_by_identifier(_mod_set)\n\n # assign the modifier set\n for rm in rooms:\n rm.properties.radiance.modifier_set = _mod_set\n", + "code": "\ntry: # import the honeybee extension\n from honeybee.model import Model\n from honeybee.room import Room\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the honeybee-radiance extension\n from honeybee_radiance.lib.modifiersets import modifier_set_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_radiance:\\n\\t{}'.format(e))\n\ntry: # import the ladybug_{{cad}} dependencies\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\nif all_required_inputs(ghenv.Component):\n # duplicate the initial objects\n rooms = [obj.duplicate() for obj in _rooms]\n\n # extract any rooms from the input Models\n hb_objs = []\n for hb_obj in rooms:\n if isinstance(hb_obj, Model):\n hb_objs.extend(hb_obj.rooms)\n elif isinstance(hb_obj, Room):\n hb_objs.append(hb_obj)\n else:\n raise ValueError(\n 'Expected Honeybee Room or Model. Got {}.'.format(type(hb_obj)))\n\n # process the input modifier set if it's a string\n if isinstance(_mod_set, str):\n _mod_set = modifier_set_by_identifier(_mod_set)\n\n # assign the modifier set\n for rm in hb_objs:\n rm.properties.radiance.modifier_set = _mod_set\n", "category": "HB-Radiance", "name": "HB Apply ModifierSet", "description": "Apply ModifierSet to Honeybee Rooms.\n-" diff --git a/honeybee_grasshopper_radiance/json/HB_Apply_Shade_Modifier.json b/honeybee_grasshopper_radiance/json/HB_Apply_Shade_Modifier.json index 213748f..d25c340 100644 --- a/honeybee_grasshopper_radiance/json/HB_Apply_Shade_Modifier.json +++ b/honeybee_grasshopper_radiance/json/HB_Apply_Shade_Modifier.json @@ -1,5 +1,5 @@ { - "version": "1.6.0", + "version": "1.6.1", "nickname": "ApplyShadeMod", "outputs": [ [ @@ -16,7 +16,7 @@ { "access": "list", "name": "_hb_objs", - "description": "Honeybee Shades, Apertures, Doors, Faces, or Rooms to which the\ninput _mod should be assigned. For the case of a Honeybee Aperture,\nDoor, Face or Room, the Modifier will be assigned to only the\nchild shades directly assigned to that object. So passing in a Room\nwill not change the modifier of shades assigned to Apertures\nof the Room's Faces. If this is the desired outcome, then the Room\nshould be deconstructed into its child objects before using\nthis component.", + "description": "Honeybee Shades, Apertures, Doors, Faces, Rooms, or a Model to which the\ninput _mod should be assigned. For the case of a Honeybee Aperture,\nDoor, Face, Room or Model, the Modifier will be assigned to only the\nchild shades directly assigned to that object. So passing in a Room\nwill not change the modifier of shades assigned to Apertures\nof the Room's Faces. If this is the desired outcome, then the Room\nshould be deconstructed into its child objects before using\nthis component.", "type": "System.Object", "default": null }, @@ -29,7 +29,7 @@ } ], "subcategory": "1 :: Modifiers", - "code": "\n\ntry: # import the honeybee-radiance extension\n from honeybee_radiance.lib.modifiers import modifier_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_radiance:\\n\\t{}'.format(e))\n\ntry: # import the core honeybee dependencies\n from honeybee.shade import Shade\n from honeybee.room import Room\n from honeybee.face import Face\n from honeybee.aperture import Aperture\n from honeybee.door import Door\n from honeybee.orientation import angles_from_num_orient, face_orient_index\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the ladybug_{{cad}} dependencies\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\nif all_required_inputs(ghenv.Component):\n # duplicate the initial objects\n hb_objs = [obj.duplicate() for obj in _hb_objs]\n\n # process the input modifiers\n for i, mod in enumerate(_mod):\n if isinstance(mod, str):\n _mod[i] = modifier_by_identifier(mod)\n\n # error message for unrecognized object\n error_msg = 'Input _hb_objs must be a Room, Face, Aperture, Door, or Shade. Not {}.'\n\n # assign the modifiers\n if len(_mod) == 1:\n for obj in hb_objs:\n if isinstance(obj, Shade):\n obj.properties.radiance.modifier = _mod[0]\n elif isinstance(obj, (Aperture, Face, Room, Door)):\n for shd in obj.shades:\n shd.properties.radiance.modifier = _mod[0]\n else:\n raise TypeError(error_msg.format(type(obj)))\n else: # assign modifiers based on cardinal direction\n angles = angles_from_num_orient(len(_mod))\n for obj in hb_objs:\n if isinstance(obj, (Aperture, Face, Door)):\n orient_i = face_orient_index(obj, angles)\n if orient_i is not None:\n for shd in obj.shades:\n shd.properties.radiance.modifier = _mod[orient_i]\n elif isinstance(obj, Shade):\n obj.properties.radiance.modifier = _mod[0]\n elif isinstance(obj, Room):\n for shd in obj.shades:\n shd.properties.radiance.modifier = _mod[0]\n else:\n raise TypeError(error_msg.format(type(obj)))\n\n", + "code": "\n\ntry: # import the honeybee-radiance extension\n from honeybee_radiance.lib.modifiers import modifier_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_radiance:\\n\\t{}'.format(e))\n\ntry: # import the core honeybee dependencies\n from honeybee.shade import Shade\n from honeybee.model import Model\n from honeybee.room import Room\n from honeybee.face import Face\n from honeybee.aperture import Aperture\n from honeybee.door import Door\n from honeybee.orientation import angles_from_num_orient, face_orient_index\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the ladybug_{{cad}} dependencies\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\nif all_required_inputs(ghenv.Component):\n # duplicate the initial objects\n hb_objs = [obj.duplicate() for obj in _hb_objs]\n\n # process the input modifiers\n for i, mod in enumerate(_mod):\n if isinstance(mod, str):\n _mod[i] = modifier_by_identifier(mod)\n\n # error message for unrecognized object\n error_msg = 'Input _hb_objs must be a Room, Face, Aperture, Door, or Shade. Not {}.'\n\n # assign the modifiers\n if len(_mod) == 1:\n for obj in hb_objs:\n if isinstance(obj, Shade):\n obj.properties.radiance.modifier = _mod[0]\n elif isinstance(obj, (Aperture, Face, Room, Door)):\n for shd in obj.shades:\n shd.properties.radiance.modifier = _mod[0]\n elif isinstance(obj, Model):\n for shd in obj.orphaned_shades:\n shd.properties.radiance.modifier = _mod[0]\n else:\n raise TypeError(error_msg.format(type(obj)))\n else: # assign modifiers based on cardinal direction\n angles = angles_from_num_orient(len(_mod))\n for obj in hb_objs:\n if isinstance(obj, (Aperture, Face, Door)):\n orient_i = face_orient_index(obj, angles)\n if orient_i is not None:\n for shd in obj.shades:\n shd.properties.radiance.modifier = _mod[orient_i]\n elif isinstance(obj, Shade):\n obj.properties.radiance.modifier = _mod[0]\n elif isinstance(obj, Room):\n for shd in obj.shades:\n shd.properties.radiance.modifier = _mod[0]\n elif isinstance(obj, Model):\n for shd in obj.orphaned_shades:\n shd.properties.radiance.modifier = _mod[0]\n else:\n raise TypeError(error_msg.format(type(obj)))\n\n", "category": "HB-Radiance", "name": "HB Apply Shade Modifier", "description": "Apply a Modifier to Honeybee Shade objects. Alternatively, it can assign a Modifier\nto all of the child shades of an Aperture, Door, Face, or a Room.\n_\nThis component supports the assigning of different modifiers based on cardinal\norientation, provided that a list of Modifiers are input to the _mod. \n-" diff --git a/honeybee_grasshopper_radiance/json/HB_Apply_Window_Modifier.json b/honeybee_grasshopper_radiance/json/HB_Apply_Window_Modifier.json index 025585b..e732ed7 100644 --- a/honeybee_grasshopper_radiance/json/HB_Apply_Window_Modifier.json +++ b/honeybee_grasshopper_radiance/json/HB_Apply_Window_Modifier.json @@ -1,5 +1,5 @@ { - "version": "1.6.0", + "version": "1.6.1", "nickname": "ApplyWindowMod", "outputs": [ [ @@ -16,7 +16,7 @@ { "access": "list", "name": "_hb_objs", - "description": "Honeybee Apertures, Faces, Doors or Rooms to which the input\n_mod should be assigned. For the case of a Honeybee Room, the\nmodifier will only be applied to the apertures in the the\nRoom's outdoor walls. Note that, if you need to assign a modifier\nto all the skylights, glass doors, etc. of a Room, the best practice\nis to create a ModifierSet and assing that to the Room.", + "description": "Honeybee Apertures, Faces, Doors, Rooms or a Model to which the input\n_mod should be assigned. For the case of Rooms or a Model, the\nmodifier will only be applied to the apertures in the the\nRoom's outdoor walls. Note that, if you need to assign a modifier\nto all the skylights, glass doors, etc. of a Room, the best practice\nis to create a ModifierSet and assing that to the Room.", "type": "System.Object", "default": null }, @@ -29,7 +29,7 @@ } ], "subcategory": "1 :: Modifiers", - "code": "\n\ntry: # import the honeybee-radiance extension\n from honeybee_radiance.lib.modifiers import modifier_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_radiance:\\n\\t{}'.format(e))\n\ntry: # import the core honeybee dependencies\n from honeybee.boundarycondition import Outdoors\n from honeybee.facetype import Wall\n from honeybee.room import Room\n from honeybee.face import Face\n from honeybee.aperture import Aperture\n from honeybee.door import Door\n from honeybee.orientation import angles_from_num_orient, face_orient_index\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the ladybug_{{cad}} dependencies\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\ndef is_exterior_wall(face):\n \"\"\"Check whether a given Face is an exterior Wall.\"\"\"\n return isinstance(face.boundary_condition, Outdoors) and \\\n isinstance(face.type, Wall)\n\n\nif all_required_inputs(ghenv.Component):\n # duplicate the initial objects\n hb_objs = [obj.duplicate() for obj in _hb_objs]\n\n # process the input modifiers\n for i, constr in enumerate(_mod):\n if isinstance(constr, str):\n _mod[i] = modifier_by_identifier(constr)\n\n # error message for unrecognized object\n error_msg = 'Input _hb_objs must be a Room, Face, Aperture, or Door. Not {}.'\n\n # assign the modifiers\n if len(_mod) == 1: # assign indiscriminately, even if it's a horizontal object\n for obj in hb_objs:\n if isinstance(obj, (Aperture, Door)):\n obj.properties.radiance.modifier = _mod[0]\n elif isinstance(obj, Face):\n for ap in obj.apertures:\n ap.properties.radiance.modifier = _mod[0]\n elif isinstance(obj, Room):\n for face in obj.faces:\n if is_exterior_wall(face):\n for ap in face.apertures:\n ap.properties.radiance.modifier = _mod[0]\n else:\n raise TypeError(error_msg.format(type(obj)))\n else: # assign modifiers only to non-horizontal objects based on cardinal direction\n angles = angles_from_num_orient(len(_mod))\n for obj in hb_objs:\n if isinstance(obj, (Aperture, Door)):\n orient_i = face_orient_index(obj, angles)\n if orient_i is not None:\n obj.properties.radiance.modifier = _mod[orient_i]\n elif isinstance(obj, Face):\n orient_i = face_orient_index(obj, angles)\n if orient_i is not None:\n for ap in obj.apertures:\n ap.properties.radiance.modifier = _mod[orient_i]\n elif isinstance(obj, Room):\n for face in obj.faces:\n if is_exterior_wall(face):\n orient_i = face_orient_index(face, angles)\n if orient_i is not None:\n for ap in face.apertures:\n ap.properties.radiance.modifier = _mod[orient_i]\n else:\n raise TypeError(error_msg.format(type(obj)))\n\n", + "code": "\n\ntry: # import the honeybee-radiance extension\n from honeybee_radiance.lib.modifiers import modifier_by_identifier\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee_radiance:\\n\\t{}'.format(e))\n\ntry: # import the core honeybee dependencies\n from honeybee.boundarycondition import Outdoors\n from honeybee.facetype import Wall\n from honeybee.model import Model\n from honeybee.room import Room\n from honeybee.face import Face\n from honeybee.aperture import Aperture\n from honeybee.door import Door\n from honeybee.orientation import angles_from_num_orient, face_orient_index\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the ladybug_{{cad}} dependencies\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\ndef is_exterior_wall(face):\n \"\"\"Check whether a given Face is an exterior Wall.\"\"\"\n return isinstance(face.boundary_condition, Outdoors) and \\\n isinstance(face.type, Wall)\n\n\nif all_required_inputs(ghenv.Component):\n # duplicate the initial objects\n hb_objs = [obj.duplicate() for obj in _hb_objs]\n\n # process the input modifiers\n for i, constr in enumerate(_mod):\n if isinstance(constr, str):\n _mod[i] = modifier_by_identifier(constr)\n\n # error message for unrecognized object\n error_msg = 'Input _hb_objs must be a Room, Face, Aperture, or Door. Not {}.'\n\n # assign the modifiers\n if len(_mod) == 1: # assign indiscriminately, even if it's a horizontal object\n for obj in hb_objs:\n if isinstance(obj, (Aperture, Door)):\n obj.properties.radiance.modifier = _mod[0]\n elif isinstance(obj, Face):\n for ap in obj.apertures:\n ap.properties.radiance.modifier = _mod[0]\n elif isinstance(obj, (Room, Model)):\n for face in obj.faces:\n if is_exterior_wall(face):\n for ap in face.apertures:\n ap.properties.radiance.modifier = _mod[0]\n else:\n raise TypeError(error_msg.format(type(obj)))\n else: # assign modifiers only to non-horizontal objects based on cardinal direction\n angles = angles_from_num_orient(len(_mod))\n for obj in hb_objs:\n if isinstance(obj, (Aperture, Door)):\n orient_i = face_orient_index(obj, angles)\n if orient_i is not None:\n obj.properties.radiance.modifier = _mod[orient_i]\n elif isinstance(obj, Face):\n orient_i = face_orient_index(obj, angles)\n if orient_i is not None:\n for ap in obj.apertures:\n ap.properties.radiance.modifier = _mod[orient_i]\n elif isinstance(obj, (Room, Model)):\n for face in obj.faces:\n if is_exterior_wall(face):\n orient_i = face_orient_index(face, angles)\n if orient_i is not None:\n for ap in face.apertures:\n ap.properties.radiance.modifier = _mod[orient_i]\n else:\n raise TypeError(error_msg.format(type(obj)))\n\n", "category": "HB-Radiance", "name": "HB Apply Window Modifier", "description": "Apply Modifier to Honeybee Apertures or glass Doors. Alternatively, it can assign\nModifiers to the child apertures of input Faces or the apertures within Room walls.\n_\nThis component supports the assigning of different modifiers based on cardinal\norientation, provided that a list of Modifiers are input to the _mod. \n-" diff --git a/honeybee_grasshopper_radiance/src/HB Apply Face Modifier.py b/honeybee_grasshopper_radiance/src/HB Apply Face Modifier.py index eb6a1ed..c329394 100644 --- a/honeybee_grasshopper_radiance/src/HB Apply Face Modifier.py +++ b/honeybee_grasshopper_radiance/src/HB Apply Face Modifier.py @@ -15,8 +15,8 @@ - Args: - _hb_objs: Honeybee Faces, Doors or Rooms to which the input _mod should - be assigned. For the case of a Honeybee Room, the modifier + _hb_objs: Honeybee Faces, Doors, Rooms or a Model to which the input _mod should + be assigned. For the case of Rooms or a Model, the modifier will only be applied to the Room's outdoor walls. Note that, if you need to assign a modifier to all the roofs, floors, etc. of a Room, the best practice is to create a ModifierSet and assing that @@ -26,14 +26,14 @@ modifier library. If an array of text or modifier objects are input here, different modifiers will be assigned based on cardinal direction, starting with north and moving clockwise. - + Returns: hb_objs: The input honeybee objects with their modifiers edited. """ ghenv.Component.Name = 'HB Apply Face Modifier' ghenv.Component.NickName = 'ApplyFaceMod' -ghenv.Component.Message = '1.6.0' +ghenv.Component.Message = '1.6.1' ghenv.Component.Category = 'HB-Radiance' ghenv.Component.SubCategory = '1 :: Modifiers' ghenv.Component.AdditionalHelpFromDocStrings = '6' @@ -47,6 +47,7 @@ try: # import the core honeybee dependencies from honeybee.boundarycondition import Outdoors from honeybee.facetype import Wall + from honeybee.model import Model from honeybee.room import Room from honeybee.face import Face from honeybee.door import Door @@ -83,7 +84,7 @@ def is_exterior_wall(face): for obj in hb_objs: if isinstance(obj, (Face, Door)): obj.properties.radiance.modifier = _mod[0] - elif isinstance(obj, Room): + elif isinstance(obj, (Room, Model)): for face in obj.faces: if is_exterior_wall(face): face.properties.radiance.modifier = _mod[0] @@ -96,7 +97,7 @@ def is_exterior_wall(face): orient_i = face_orient_index(obj, angles) if orient_i is not None: obj.properties.radiance.modifier = _mod[orient_i] - elif isinstance(obj, Room): + elif isinstance(obj, (Room, Model)): for face in obj.faces: if is_exterior_wall(face): orient_i = face_orient_index(face, angles) diff --git a/honeybee_grasshopper_radiance/src/HB Apply ModifierSet.py b/honeybee_grasshopper_radiance/src/HB Apply ModifierSet.py index c80797f..0b68662 100644 --- a/honeybee_grasshopper_radiance/src/HB Apply ModifierSet.py +++ b/honeybee_grasshopper_radiance/src/HB Apply ModifierSet.py @@ -13,21 +13,28 @@ Args: _rooms: Honeybee Rooms to which the input _mod_set should be assigned. + This can also be a Honeybee Model for which all Rooms + will be assigned the ModifierSet. _mod_set: A Honeybee ModifierSet to be applied to the input _room. This can also be text for a modifier set to be looked up in the modifier set library. - + Returns: rooms: The input Rooms with their modifier sets edited. """ ghenv.Component.Name = 'HB Apply ModifierSet' ghenv.Component.NickName = 'ApplyModSet' -ghenv.Component.Message = '1.6.0' +ghenv.Component.Message = '1.6.1' ghenv.Component.Category = 'HB-Radiance' ghenv.Component.SubCategory = '1 :: Modifiers' ghenv.Component.AdditionalHelpFromDocStrings = '6' +try: # import the honeybee extension + from honeybee.model import Model + from honeybee.room import Room +except ImportError as e: + raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e)) try: # import the honeybee-radiance extension from honeybee_radiance.lib.modifiersets import modifier_set_by_identifier @@ -44,10 +51,21 @@ # duplicate the initial objects rooms = [obj.duplicate() for obj in _rooms] + # extract any rooms from the input Models + hb_objs = [] + for hb_obj in rooms: + if isinstance(hb_obj, Model): + hb_objs.extend(hb_obj.rooms) + elif isinstance(hb_obj, Room): + hb_objs.append(hb_obj) + else: + raise ValueError( + 'Expected Honeybee Room or Model. Got {}.'.format(type(hb_obj))) + # process the input modifier set if it's a string if isinstance(_mod_set, str): _mod_set = modifier_set_by_identifier(_mod_set) # assign the modifier set - for rm in rooms: + for rm in hb_objs: rm.properties.radiance.modifier_set = _mod_set diff --git a/honeybee_grasshopper_radiance/src/HB Apply Shade Modifier.py b/honeybee_grasshopper_radiance/src/HB Apply Shade Modifier.py index fbddba0..cf3df31 100644 --- a/honeybee_grasshopper_radiance/src/HB Apply Shade Modifier.py +++ b/honeybee_grasshopper_radiance/src/HB Apply Shade Modifier.py @@ -16,9 +16,9 @@ - Args: - _hb_objs: Honeybee Shades, Apertures, Doors, Faces, or Rooms to which the + _hb_objs: Honeybee Shades, Apertures, Doors, Faces, Rooms, or a Model to which the input _mod should be assigned. For the case of a Honeybee Aperture, - Door, Face or Room, the Modifier will be assigned to only the + Door, Face, Room or Model, the Modifier will be assigned to only the child shades directly assigned to that object. So passing in a Room will not change the modifier of shades assigned to Apertures of the Room's Faces. If this is the desired outcome, then the Room @@ -29,14 +29,14 @@ modifier library. If an array of text or modifier objects are input here, different modifiers will be assigned based on cardinal direction, starting with north and moving clockwise. - + Returns: hb_objs: The input honeybee objects with their modifiers edited. """ ghenv.Component.Name = 'HB Apply Shade Modifier' ghenv.Component.NickName = 'ApplyShadeMod' -ghenv.Component.Message = '1.6.0' +ghenv.Component.Message = '1.6.1' ghenv.Component.Category = 'HB-Radiance' ghenv.Component.SubCategory = '1 :: Modifiers' ghenv.Component.AdditionalHelpFromDocStrings = '6' @@ -49,6 +49,7 @@ try: # import the core honeybee dependencies from honeybee.shade import Shade + from honeybee.model import Model from honeybee.room import Room from honeybee.face import Face from honeybee.aperture import Aperture @@ -83,6 +84,9 @@ elif isinstance(obj, (Aperture, Face, Room, Door)): for shd in obj.shades: shd.properties.radiance.modifier = _mod[0] + elif isinstance(obj, Model): + for shd in obj.orphaned_shades: + shd.properties.radiance.modifier = _mod[0] else: raise TypeError(error_msg.format(type(obj))) else: # assign modifiers based on cardinal direction @@ -98,6 +102,9 @@ elif isinstance(obj, Room): for shd in obj.shades: shd.properties.radiance.modifier = _mod[0] + elif isinstance(obj, Model): + for shd in obj.orphaned_shades: + shd.properties.radiance.modifier = _mod[0] else: raise TypeError(error_msg.format(type(obj))) diff --git a/honeybee_grasshopper_radiance/src/HB Apply Window Modifier.py b/honeybee_grasshopper_radiance/src/HB Apply Window Modifier.py index 8a01879..96d8fa3 100644 --- a/honeybee_grasshopper_radiance/src/HB Apply Window Modifier.py +++ b/honeybee_grasshopper_radiance/src/HB Apply Window Modifier.py @@ -16,8 +16,8 @@ - Args: - _hb_objs: Honeybee Apertures, Faces, Doors or Rooms to which the input - _mod should be assigned. For the case of a Honeybee Room, the + _hb_objs: Honeybee Apertures, Faces, Doors, Rooms or a Model to which the input + _mod should be assigned. For the case of Rooms or a Model, the modifier will only be applied to the apertures in the the Room's outdoor walls. Note that, if you need to assign a modifier to all the skylights, glass doors, etc. of a Room, the best practice @@ -27,14 +27,14 @@ modifier library. If an array of text or modifier objects are input here, different modifiers will be assigned based on cardinal direction, starting with north and moving clockwise. - + Returns: hb_objs: The input honeybee objects with their modifiers edited. """ ghenv.Component.Name = 'HB Apply Window Modifier' ghenv.Component.NickName = 'ApplyWindowMod' -ghenv.Component.Message = '1.6.0' +ghenv.Component.Message = '1.6.1' ghenv.Component.Category = 'HB-Radiance' ghenv.Component.SubCategory = '1 :: Modifiers' ghenv.Component.AdditionalHelpFromDocStrings = '6' @@ -48,6 +48,7 @@ try: # import the core honeybee dependencies from honeybee.boundarycondition import Outdoors from honeybee.facetype import Wall + from honeybee.model import Model from honeybee.room import Room from honeybee.face import Face from honeybee.aperture import Aperture @@ -88,7 +89,7 @@ def is_exterior_wall(face): elif isinstance(obj, Face): for ap in obj.apertures: ap.properties.radiance.modifier = _mod[0] - elif isinstance(obj, Room): + elif isinstance(obj, (Room, Model)): for face in obj.faces: if is_exterior_wall(face): for ap in face.apertures: @@ -107,7 +108,7 @@ def is_exterior_wall(face): if orient_i is not None: for ap in obj.apertures: ap.properties.radiance.modifier = _mod[orient_i] - elif isinstance(obj, Room): + elif isinstance(obj, (Room, Model)): for face in obj.faces: if is_exterior_wall(face): orient_i = face_orient_index(face, angles) diff --git a/honeybee_grasshopper_radiance/user_objects/HB Apply Face Modifier.ghuser b/honeybee_grasshopper_radiance/user_objects/HB Apply Face Modifier.ghuser index f424111..f9670bc 100644 Binary files a/honeybee_grasshopper_radiance/user_objects/HB Apply Face Modifier.ghuser and b/honeybee_grasshopper_radiance/user_objects/HB Apply Face Modifier.ghuser differ diff --git a/honeybee_grasshopper_radiance/user_objects/HB Apply ModifierSet.ghuser b/honeybee_grasshopper_radiance/user_objects/HB Apply ModifierSet.ghuser index 0e84734..ec9e7fa 100644 Binary files a/honeybee_grasshopper_radiance/user_objects/HB Apply ModifierSet.ghuser and b/honeybee_grasshopper_radiance/user_objects/HB Apply ModifierSet.ghuser differ diff --git a/honeybee_grasshopper_radiance/user_objects/HB Apply Shade Modifier.ghuser b/honeybee_grasshopper_radiance/user_objects/HB Apply Shade Modifier.ghuser index 4364dbe..61c26a7 100644 Binary files a/honeybee_grasshopper_radiance/user_objects/HB Apply Shade Modifier.ghuser and b/honeybee_grasshopper_radiance/user_objects/HB Apply Shade Modifier.ghuser differ diff --git a/honeybee_grasshopper_radiance/user_objects/HB Apply Window Modifier.ghuser b/honeybee_grasshopper_radiance/user_objects/HB Apply Window Modifier.ghuser index dbc7351..8a06983 100644 Binary files a/honeybee_grasshopper_radiance/user_objects/HB Apply Window Modifier.ghuser and b/honeybee_grasshopper_radiance/user_objects/HB Apply Window Modifier.ghuser differ