diff --git a/honeybee_grasshopper_core/icon/HB Faces by Type.png b/honeybee_grasshopper_core/icon/HB Faces by Type.png index 2fd73a0..027e187 100644 Binary files a/honeybee_grasshopper_core/icon/HB Faces by Type.png and b/honeybee_grasshopper_core/icon/HB Faces by Type.png differ diff --git a/honeybee_grasshopper_core/json/HB_Faces_by_Type.json b/honeybee_grasshopper_core/json/HB_Faces_by_Type.json index f6ac988..b404336 100644 --- a/honeybee_grasshopper_core/json/HB_Faces_by_Type.json +++ b/honeybee_grasshopper_core/json/HB_Faces_by_Type.json @@ -1,5 +1,5 @@ { - "version": "1.8.0", + "version": "1.8.1", "nickname": "FacesByType", "outputs": [ [ @@ -106,7 +106,7 @@ } ], "subcategory": "2 :: Organize", - "code": "\ntry: # import the core honeybee dependencies\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.shade import Shade\n from honeybee.shademesh import ShadeMesh\n from honeybee.boundarycondition import Surface\n from honeybee.facetype import Wall, RoofCeiling, Floor, AirBoundary\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\ntry: # import the honeybee-energy extension\n from honeybee.boundarycondition import Adiabatic\nexcept ImportError: # honeybee-energy not installed\n Adiabatic = None # don't worry about Aidabatic; Surface is the only interior bc\n\n\ndef add_shade(hb_obj):\n \"\"\"Add an object's shades to the relevant lists.\"\"\"\n outdoor_shades.extend([shd for shd in hb_obj.outdoor_shades])\n indoor_shades.extend([shd for shd in hb_obj.indoor_shades])\n\ndef add_door(dr):\n \"\"\"Add a door to the relevant lists.\"\"\"\n bc = dr.boundary_condition\n add_shade(dr)\n if isinstance(bc, Surface):\n interior_doors.append(dr)\n else:\n doors.append(dr)\n\ndef add_aperture(ap):\n \"\"\"Add an aperture to the relevant lists.\"\"\"\n bc = ap.boundary_condition\n add_shade(ap)\n if isinstance(bc, Surface):\n interior_apertures.append(ap)\n else:\n apertures.append(ap)\n\ndef add_face(face):\n \"\"\"Add a face to the relevant lists.\"\"\"\n add_shade(face)\n bc = face.boundary_condition\n type = face.type\n if isinstance(type, Wall):\n if isinstance(bc, (Surface, Adiabatic)):\n interior_walls.append(face)\n else:\n walls.append(face)\n elif isinstance(type, RoofCeiling):\n if isinstance(bc, (Surface, Adiabatic)):\n ceilings.append(face)\n else:\n roofs.append(face)\n elif isinstance(type, Floor):\n if isinstance(bc, (Surface, Adiabatic)):\n interior_floors.append(face)\n else:\n exterior_floors.append(face)\n elif isinstance(type, AirBoundary):\n air_walls.append(face)\n\n # add the apertures, doors, and shades\n for ap in face.apertures:\n add_aperture(ap)\n for dr in face.doors:\n add_door(dr)\n\n\nif all_required_inputs(ghenv.Component):\n # lists of {{cad}} geometry to be filled with content\n walls = []\n interior_walls = []\n roofs = []\n ceilings = []\n exterior_floors = []\n interior_floors = []\n air_walls = []\n apertures = []\n interior_apertures = []\n doors = []\n interior_doors = []\n outdoor_shades = []\n indoor_shades = []\n shade_meshes = []\n\n # loop through all objects and add them\n for obj in _hb_objs:\n if isinstance(obj, Model):\n for room in obj.rooms:\n for face in room.faces:\n add_face(face)\n for face in obj.orphaned_faces:\n add_face(face)\n for ap in obj.orphaned_apertures:\n add_aperture(ap)\n for dr in obj.orphaned_doors:\n add_door(dr)\n outdoor_shades.extend(obj.orphaned_shades)\n outdoor_shades.extend(obj.shade_meshes)\n elif isinstance(obj, Room):\n add_shade(obj)\n for face in obj:\n add_face(face)\n elif isinstance(obj, Face):\n add_face(obj)\n elif isinstance(obj, Aperture):\n add_aperture(obj)\n elif isinstance(obj, Door):\n add_door(obj)\n elif isinstance(obj, Shade):\n outdoor_shades.append(obj)\n elif isinstance(obj, ShadeMesh):\n outdoor_shades.append(obj)", + "code": "\ntry: # import the core honeybee dependencies\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.shade import Shade\n from honeybee.shademesh import ShadeMesh\n from honeybee.boundarycondition import Surface\n from honeybee.facetype import Wall, RoofCeiling, Floor, AirBoundary\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\ntry: # import the honeybee-energy extension\n from honeybee.boundarycondition import Adiabatic\nexcept ImportError: # honeybee-energy not installed\n Adiabatic = None # don't worry about Aidabatic; Surface is the only interior bc\n\n\ndef add_shade(hb_obj):\n \"\"\"Add an object's shades to the relevant lists.\"\"\"\n outdoor_shades.extend([shd for shd in hb_obj.outdoor_shades])\n indoor_shades.extend([shd for shd in hb_obj.indoor_shades])\n\ndef add_door(dr):\n \"\"\"Add a door to the relevant lists.\"\"\"\n bc = dr.boundary_condition\n add_shade(dr)\n if isinstance(bc, Surface):\n interior_doors.append(dr)\n else:\n doors.append(dr)\n\ndef add_aperture(ap):\n \"\"\"Add an aperture to the relevant lists.\"\"\"\n bc = ap.boundary_condition\n add_shade(ap)\n if isinstance(bc, Surface):\n interior_apertures.append(ap)\n else:\n apertures.append(ap)\n\ndef add_face(face):\n \"\"\"Add a face to the relevant lists.\"\"\"\n add_shade(face)\n bc = face.boundary_condition\n type = face.type\n if isinstance(type, Wall):\n if isinstance(bc, (Surface, Adiabatic)):\n interior_walls.append(face)\n else:\n walls.append(face)\n elif isinstance(type, RoofCeiling):\n if isinstance(bc, (Surface, Adiabatic)):\n ceilings.append(face)\n else:\n roofs.append(face)\n elif isinstance(type, Floor):\n if isinstance(bc, (Surface, Adiabatic)):\n interior_floors.append(face)\n else:\n exterior_floors.append(face)\n elif isinstance(type, AirBoundary):\n air_walls.append(face)\n\n # add the apertures, doors, and shades\n for ap in face.apertures:\n add_aperture(ap)\n for dr in face.doors:\n add_door(dr)\n\n\nif all_required_inputs(ghenv.Component):\n # lists of {{cad}} geometry to be filled with content\n walls = []\n interior_walls = []\n roofs = []\n ceilings = []\n exterior_floors = []\n interior_floors = []\n air_walls = []\n apertures = []\n interior_apertures = []\n doors = []\n interior_doors = []\n outdoor_shades = []\n indoor_shades = []\n shade_meshes = []\n\n # loop through all objects and add them\n for obj in _hb_objs:\n if isinstance(obj, Model):\n for room in obj.rooms:\n add_shade(room)\n for face in room.faces:\n add_face(face)\n for face in obj.orphaned_faces:\n add_face(face)\n for ap in obj.orphaned_apertures:\n add_aperture(ap)\n for dr in obj.orphaned_doors:\n add_door(dr)\n outdoor_shades.extend(obj.orphaned_shades)\n outdoor_shades.extend(obj.shade_meshes)\n elif isinstance(obj, Room):\n add_shade(obj)\n for face in obj:\n add_face(face)\n elif isinstance(obj, Face):\n add_face(obj)\n elif isinstance(obj, Aperture):\n add_aperture(obj)\n elif isinstance(obj, Door):\n add_door(obj)\n elif isinstance(obj, Shade):\n if obj.is_indoor:\n indoor_shades.append(obj)\n else:\n outdoor_shades.append(obj)\n elif isinstance(obj, ShadeMesh):\n outdoor_shades.append(obj)", "category": "Honeybee", "name": "HB Faces by Type", "description": "Separate the faces/sub-faces of honeybee Rooms, Faces, Apertures, Doors, or Shades\nby object and face type.\n-" diff --git a/honeybee_grasshopper_core/src/HB Faces by Type.py b/honeybee_grasshopper_core/src/HB Faces by Type.py index 662a815..1c2ecf7 100644 --- a/honeybee_grasshopper_core/src/HB Faces by Type.py +++ b/honeybee_grasshopper_core/src/HB Faces by Type.py @@ -36,7 +36,7 @@ ghenv.Component.Name = 'HB Faces by Type' ghenv.Component.NickName = 'FacesByType' -ghenv.Component.Message = '1.8.0' +ghenv.Component.Message = '1.8.1' ghenv.Component.Category = 'Honeybee' ghenv.Component.SubCategory = '2 :: Organize' ghenv.Component.AdditionalHelpFromDocStrings = '3' @@ -139,6 +139,7 @@ def add_face(face): for obj in _hb_objs: if isinstance(obj, Model): for room in obj.rooms: + add_shade(room) for face in room.faces: add_face(face) for face in obj.orphaned_faces: @@ -160,6 +161,9 @@ def add_face(face): elif isinstance(obj, Door): add_door(obj) elif isinstance(obj, Shade): - outdoor_shades.append(obj) + if obj.is_indoor: + indoor_shades.append(obj) + else: + outdoor_shades.append(obj) elif isinstance(obj, ShadeMesh): outdoor_shades.append(obj) \ No newline at end of file diff --git a/honeybee_grasshopper_core/user_objects/HB Faces by Type.ghuser b/honeybee_grasshopper_core/user_objects/HB Faces by Type.ghuser index c5c9c22..28639da 100644 Binary files a/honeybee_grasshopper_core/user_objects/HB Faces by Type.ghuser and b/honeybee_grasshopper_core/user_objects/HB Faces by Type.ghuser differ diff --git a/samples/model_creation_workflows.gh b/samples/model_creation_workflows.gh index 62e1479..c8f708a 100644 Binary files a/samples/model_creation_workflows.gh and b/samples/model_creation_workflows.gh differ