Help with list lacing and levels

I want to filter to a list of sheets with sheet numbers specified in a list. This is where my understanding of lists ends. How do I use levels and lacing to achieve a list of my 19 sheets (from my code block with all the Sheet Numbers) in the “In” output of the Filter by Boolean Mask node? So far I am only getting results in the “Out” output.

A few different ways to do it. I’d probably just set the == to cross product with list levels off and that should do the trick. Or you can leave lacing on default and run X@L1, Y@default with a flatten before the input. Then you can use an ‘AnyTrue’ node, or ‘List.Contains’ with ‘true’ before your ‘BoolMask’.

This should guide you along:

Note that it helps to test smaller lists - around a total of 15 tests (so 5 sheets against 3 words) makes it easier to understand.

4 Likes

I see the difference in list structures at your end results, so that is helpful for my planning.
However, I am still not getting my desired results, see below:

Your method 1 (green groups):

Your method 2 (salmon groups):

EDIT: I simplified the script and got the result I expected. Still, I don’t see how to apply this basic version to my original situation. Would you please bridge this gap?

Simply setting the == node to cross-product hasn’t solved it, take a look:

Neither did your second method work as I understand it:

You need to use an AnyTrue or List.Contains True after the == node to get the intended result from a cross-product list. You can then feed this second list of booleans into your FilterByBoolMask.

Super quick example:

That still isn’t working:

Your mask has been sorted but your list hasn’t, so you’re using the right true/false value but on the wrong list. Either feed the sorted list into the BoolMask, or skip the sort node and sort after filtering.

1 Like

That did it. I was convinced I had done the lacing or levels incorrectly so I didn’t catch my unfinished sorting. Thank you.

My example utilized Auto lacing in all cases - you set the nodes to longest which will change the way the nodes process the data. :slight_smile:

1 Like

I looked for Auto lacing but I didn’t see it in the lacing options. I tried unchecking Longest but that just went to Shortest. I’m using Dynamo in Revit 2019, could that be why I don’t see Auto?

Which Dynamo version? Pretty sure it was a thing in Dynamo 2.X in Revit 2019, but I might have it the wrong way around.

2 Likes

Likely you’re in the version of Dynamo which comes pre-installed with Revit 2019. I blieve it’s 1.3.2 or 1.3.4. I highly recommend upgrading to 2.0.4 as that will enable the graphs you build for 2019 can be more easily upgraded to work in Revit 2020 and beyond, where there is a file format change with the 2.3 or later format.

1 Like

You’re right, I haven’t installed any updates. I’ll do so, thanks for the suggestion!

1 Like