Beispiel #1
0
def main():
    if _buildings:

        # default materials
        if commonWallMaterial_: commonWallMaterial = commonWallMaterial_
        else: commonWallMaterial = '00'
        if commonRoofMaterial_: commonRoofMaterial = commonRoofMaterial_
        else: commonRoofMaterial = '00'

        breps = geometry.buildingGeometry(_buildings)
        #buildings = breps.fromBrepToMesh() # meshes are faster than breps but not accurate! :P

        materials = material.SetMaterials.createMaterialListForBuildings(
            _wallMaterial_, _roofMaterial_, _buildings, commonWallMaterial,
            commonRoofMaterial)
        envObj = material.SetMaterials(
            _buildings, materials, [commonWallMaterial, commonRoofMaterial], 0,
            'Building')

        return envObj

    else:
        w = gh.GH_RuntimeMessageLevel.Warning
        message = "Please provide _buildings."
        ghenv.Component.AddRuntimeMessage(w, message)
        return -1
Beispiel #2
0
def main():
    if _source:
        checkGeometry(_source)
        # run envimet core
        envObj = material.SetMaterials(_source, _sourceId_, 'FT', 0, 'Source')

        return envObj

    else:
        w = gh.GH_RuntimeMessageLevel.Warning
        message = "Please provide _source."
        ghenv.Component.AddRuntimeMessage(w, message)
        return -1
Beispiel #3
0
def main():
    if _plant3D:
        checkGeometry(_plant3D)
        # run envimet core
        envObj = material.SetMaterials(_plant3D, _plant3Did_, 'PI,.Pinus Pinea', 1, 'Plant3d')
        
        return envObj
        
    else:
        w = gh.GH_RuntimeMessageLevel.Warning
        message = "Please provide _plant3D."
        ghenv.Component.AddRuntimeMessage(w, message)
        return -1
Beispiel #4
0
def main():
    if _plant2D:
        checkGeometry(_plant2D)
        # run envimet core
        envObj = material.SetMaterials(_plant2D, _plantId_, 'XX', 0, 'Plant2d')
        
        return envObj
        
    else:
        w = gh.GH_RuntimeMessageLevel.Warning
        message = "Please provide _plant2D."
        ghenv.Component.AddRuntimeMessage(w, message)
        return -1
Beispiel #5
0
def main():
    if _soil:
        checkGeometry(_soil)

        if baseSoilmaterial_: baseSoilmaterial = baseSoilmaterial_
        else: baseSoilmaterial = 'LO'

        # run envimet core
        envObj = material.SetMaterials(_soil, _soilId_, 'LO', 0, 'Soil',
                                       baseSoilmaterial)

        return envObj

    else:
        w = gh.GH_RuntimeMessageLevel.Warning
        message = "Please provide _soil."
        ghenv.Component.AddRuntimeMessage(w, message)
        return -1