List levels not working anymore?

How is this possible?

You are using @L1, so you are counting the elements themselves - there is one of me, one of you, one of each.

What you want to do is count @L2 as this is ‘how many elements are in this list’.

Counting @L3 is how many lists are in my list of lists.

@L4 is how many lists of lists of lists… etc.

Jacob, thank you,

I have “expanded” my screen shots to include all 3 levels of my data, and it still makes no sense, apologies.

How would you obtain the number of elements in each of those list?
Why is the 3rd item (index 2) showing 1 count instead of 2?

What is feeding into the Watch node? Something tells me I am not looking at a standard Dynamo list… Perhaps you have passed a Python collection other than a list, or a Python conversion of a .NET collection?

It’s the IN list of a List.FilterByBooleanMask.

And i have no idea what else are you talking about :sob:

Using a different list it works with level2:

I don’t understand how this list is different from the one in the script, from the Boolean mask node…

And even using a mixed of single element list, or actual single elements, same results:

Well, to help I need to see the data flow from before the watch node. What goes into the filter by book mask node? Where did you originally create the list or elements?

Another thing you can try: put an Object.Type node in the canvas to see if there is something amiss.

Incredibly, flattening the list at level @1, which creates a list apparently identical, solves the problem, and makes Count predictable again:

Yes, look at this, the list coming from the FilterByBoolean mask has different elements than the flattened list…

I have never seen this before, and I have used FilterByBoolean Mask and list management together in many scirpts… :exploding_head:

“Count” was reading the number of CollectionArrays correctly, as you can see from the Object.Type node…!

Jacob, the more I look at this and the more it looks like a bug?

I don’t think I have ever seen these SystemCollectionsArrayList out of the FilterByBooleanMask, before…

Please export an image of the full graph as per the instructions here.

That way we can confirm all the data flow. Be sure to expand any node previews coming from the relevant data that produced the original list (pre filtering).

Can you also confirm which version of Revit and Dynamo for Revit you’re in?

I sent you a message with the info you requested.

Regards.