Filter list by boolean in dynamo

hi all , i am very new to dynamo and i want to do a generative design. I have facade panels and i wanted to isolate those who have a normal vector from sunlight that is comprised between 45 and 90 degrees. After selecting that list i want to keep the panels and randomise their position on the facade so i can assign transparent panels on those and make the rest opaque. i tried all logical nods i could do but it doesnt lead anywhere.any help is appareciated

Hello @sarra.hadji and welcome to the forum…its very difficult to sse whats goin on, you need to zoom in your image…but one thing i can see is you try to feed in a double in string contain…

1 Like

As @sovitek said,you need a string to search within a string, a workaround might be rounding your numbers and compare them using an == operator as a mask.

1 Like

Hi @sarra.hadji ,

The method you are using right now is pretty flawed since you are comparing your values, which aren’t rounded (and also aren’t strings) against integers. So this method will never give consistent results and would require a lot of extra coding work which simply isn’t needed :slight_smile: .

A better approach would be a Code Block with two IF-statements and one AND-statement. Now we’re asking for each value in the list if the angle is higher than 45 degrees AND lower than 90 degrees. And then if only both are true, return a true.

angle > 45 && angle < 90;

Also please use this button for taking screenshots of your Dynamo Graph, your node names are currently unreadable :slight_smile:

1 Like