예제 #1
0
def create_HB_material_no_mass(_material_name, _material_r_value):
    """ Creates an HB Style "No-Mass" Material """

    try:
        # set the default material properties
        name = _material_name
        r_value = _material_r_value
        roughness = 'MediumRough'
        therm_absp = 0.9
        sol_absp = 0.7
        vis_absp = 0.7

        # create the NoMass material
        mat = EnergyMaterialNoMass(clean_and_id_ep_string(name), r_value,
                                   roughness, therm_absp, sol_absp, vis_absp)
        mat.display_name = name

        return mat
    except Exception as e:
        print('Error creating HB Material', e)
        return None
예제 #2
0
ghenv.Component.AdditionalHelpFromDocStrings = "5"

try:  # import the core honeybee dependencies
    from honeybee.typing import clean_and_id_ep_string, clean_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.opaque import EnergyMaterialNoMass
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
    _roughness_ = 'MediumRough' if _roughness_ is None else _roughness_
    _therm_absp_ = 0.9 if _therm_absp_ is None else _therm_absp_
    _sol_absp_ = 0.7 if _sol_absp_ is None else _sol_absp_
    name = clean_and_id_ep_string('OpaqueNoMassMaterial') if _name_ is None else \
        clean_ep_string(_name_)

    # create the material
    mat = EnergyMaterialNoMass(name, _r_value, _roughness_, _therm_absp_,
                               _sol_absp_, _vis_absp_)
    if _name_ is not None:
        mat.display_name = _name_