Exemplo n.º 1
0
def create_EP_window_mat(_win_obj):
    """ Creates an E+ style material for the window based on the PHPP U-W-Installed

    Args:
        _win_obj (): The PHPP-Style window object
    Returns:
        mat: The window E+ Material
    
    """

    # Material properties
    name = 'PHPP_MAT_{}'.format(_win_obj.name)
    u_factor = _win_obj.u_w_installed
    shgc = _win_obj.glazing.gValue
    t_vis = 0.6

    # Create the material
    mat = EnergyWindowMaterialSimpleGlazSys(
        clean_and_id_ep_string(name), u_factor, shgc, t_vis)
    mat.display_name = name

    return mat
ghenv.Component.Name = "HB Window Material"
ghenv.Component.NickName = 'WindowMat'
ghenv.Component.Message = '0.1.2'
ghenv.Component.Category = 'HB-Energy'
ghenv.Component.SubCategory = "1 :: Constructions"
ghenv.Component.AdditionalHelpFromDocStrings = "5"

try:  # import the core honeybee dependencies
    from honeybee.typing import clean_and_id_ep_string
except ImportError as e:
    raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))

try:  # import the honeybee-energy dependencies
    from honeybee_energy.material.glazing import EnergyWindowMaterialSimpleGlazSys
except ImportError as e:
    raise ImportError('\nFailed to import honeybee_energy:\n\t{}'.format(e))

try:  # import ladybug_rhino dependencies
    from ladybug_rhino.grasshopper import all_required_inputs
except ImportError as e:
    raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e))

if all_required_inputs(ghenv.Component):
    # set the default material properties
    _t_vis_ = 0.6 if _t_vis_ is None else _t_vis_

    # create the material
    mat = EnergyWindowMaterialSimpleGlazSys(clean_and_id_ep_string(_name),
                                            _u_factor, _shgc, _t_vis_)
    mat.display_name = _name