Filter list by boolean mask in DSDynamo

Hi,

I’m using dynamo daily 0.7.1.23088 and I’m having a few issues.

First of all how do I use the “List.FilterByBoolMask” node?

I’ve tried feeding it “1” and “0” or “True” and “False” but I keep getting the following error:

Warning: List.FilterByBoolMask operation failed.
Specified cast is not valid.

2014-07-04_163229

 

 

 

 

Also when I try to add the “Categories” node I get the following error:

Failed to load built-in type
System.InvalidCastException:
Unable to cast object of type ‘Dynamo.Nodes.Categories’ to type ‘Dynamo.Models.NodeModel’.
at Dynamo.Models.DynamoModel.CreateNodeInstance(String name)
Failed to create node ‘Categories’ (GUID: 3b1cd225-102b-432f-aa67-752bfb004857)

Any ideas on what’s causing it?

Thank you for your assistance.

1 Like

If I manually make a list of outputs from the “Boolean” node, the filter by Boolean operation works like expected. Any ideas why it isn’t working for the automatically generated Booleans?

2014-07-04_171534

There is a bug with the output port of the watch node. Try running directly from the output of the IF node

I don’t think the bug is in the watch node. I removed all watch nodes and got the same error. Then I decided to remove the “IF” node and connect the “==” node straight to the filter node and everything worked as expected. Maybe there’s something wrong with the way I used the “IF” node

Any Idea why I can’t call the “Categories” node?

Hi Dimitar, List.FilterByBoolMask expects a list of boolean value, but the value you feed to IF node is string values “true” or “false” (in watch node string value won’t be put in “”). Could you remove " in code block node and try again?

You can also use Boolean node instead of writing true and false CBN. (I prefer writing in CBN but just see that works for you or not :slight_smile: )

Ritesh was right once again. Instead of trying to trick the “IF” node with strings, I should have fed it with Boolean values from the start. Dynamo does not fall for my trickery :slight_smile:

2014-07-09_172537

 

 

 

 

However the if node is actually completely unnecessary because the operator nodes in the new dynamo can now process lists and give Boolean values straight away. So we can simplify things a bit:

2014-07-09_172406

thanks. I finally get how to use filter by boolean mask :stuck_out_tongue:

I’m sorry, I seem to create extra topic

http://dynamobim.com/forums/topic/filterbyboolmask/