MeshSelector on mulitple results not working when levelOfPreform not met

If in one of the meshes the levelOfPreform is not met by one element, a Div by 0 occurs in line 185.

if you catch a 0 area first, it works. I modified the code like this:

    if totalArea>0:
        totalEnergy = (sum(shadeNetFinal)/len(shadeNetFinal))*totalArea

Since i’m not familiar with github i can’t update the code there (and i’m pretty sure the error can be avoided with a more elegant code)

Best regards,

Thanks Heiko, this would be great!

Hi Elzine, you can just modify the MeshSelector object by yourself. Doubleclick on
the icon or text in the middle and replace the marked line in the screenshot with the code above.

Tabs in front of the commands are important for python, should look like this:

@HeikoWoehrle ,

If you send a pull request to the ladybug GitHub with this change, I will merge it in and then we all can benefit from it when we update our components. Also, this will get you into the ladybug contributors page.

Here’s a video series @mostapha put together about how to send a code contribution to ladybug:

Thanks @chris (and mostapha for the video) for the explanation. I just made the pull request. Doing this i realized i edited the wrong lines for the screenshot of this inital post. i just corrected them also. Sorry for spending confusion…

Thanks @HeikoWoehrle . I looked over your PR and you can see that there’s one tweak to make (updating the component date) and then we can merge it in!