def to_honeybee(self): """Convert Dragonfly ContextShade to an array of Honeybee Shades.""" shades = [] for i, shd_geo in enumerate(self._geometry): # create the shade object shade = Shade('{}_{}'.format(self.identifier, i), shd_geo) shade.display_name = '{}_{}'.format(self.display_name, i) # transfer any extension properties assigned to the Shade shade._properties = self.properties.to_honeybee(shade) shades.append(shade) return shades
shades = [] # list of shades that will be returned for j, geo in enumerate(_geo): if len(_name_) == 0: # make a default Shade name name = display_name = clean_and_id_string('Shade') else: display_name = '{}_{}'.format(longest_list(_name_, j), j + 1) \ if len(_name_) != len(_geo) else longest_list(_name_, j) name = clean_and_id_string(display_name) is_detached = not longest_list(attached_, j) if len(attached_) != 0 else True lb_faces = to_face3d(geo) for i, lb_face in enumerate(lb_faces): shd_name = '{}_{}'.format(name, i) if len(lb_faces) > 1 else name hb_shd = Shade(shd_name, lb_face, is_detached) hb_shd.display_name = display_name # try to assign the energyplus construction if len(ep_constr_) != 0: ep_constr = longest_list(ep_constr_, j) if isinstance(ep_constr, str): ep_constr = shade_construction_by_identifier(ep_constr) hb_shd.properties.energy.construction = ep_constr # try to assign the energyplus transmittance schedule if len(ep_trans_sch_) != 0: ep_trans_sch = longest_list(ep_trans_sch_, j) if isinstance(ep_trans_sch, str): ep_trans_sch = schedule_by_identifier(ep_trans_sch) hb_shd.properties.energy.transmittance_schedule = ep_trans_sch