ladybug-tools-in2 / standards-measure

Other
0 stars 0 forks source link

Sample Code to Retrieve All Materials and Properties #3

Open chriswmackey opened 5 years ago

chriswmackey commented 5 years ago

This one is third priority behind https://github.com/ladybug-tools-in2/standards-measure/issues/2

I think this one should be pretty simple in that we simply want to import the whole library of all materials. This is not only for use in constructions that satisfy certain standards but also for people to make their own constructions from the materials if they like. So some smaple code like this should be fine:

opaque_materials = {}
window_materials = {}

for material_name in all_materials:
        if material.type is 'Material:SimpleGlazingSystem' or material.type is 'Material:Glass':
                window_materials [material_name] = get_material()
        else:
                opaque_materials[material_name] = get_material()

In this case, get_material() should get the material type and properties from the gem.

mdahlhausen commented 5 years ago

see issue #2 for example code on getting material names and properties.