Selecting and Filtering


Hi all,
Im having real issues with something that i feel should be quite simple. I had a great idea to use Dynamo to run through our Revit files to try to pick up some elements that do not conform to our naming protocol.

In the first instance, i owul dlike to select all of the walls in the porject and create a list of all the walls that do not match our naming. In the instace below, i need to mask out the “BK-1.40 (140 BK)” and “BR-0.90 (90 BR)” types and only list the Wall 1, Wall 2, Wall 3 items.

i have tried “List.FilterByBoolMask” but i cant work out what to connect to the mask plug to remove the correct items and just cant get it to work.
Any help appreciated.


Hi @Andrew_Harp


HI there,
Thanks for that.
Looks great but the issue is i want to create a list without the BK and BR walls. So the list would only show Wall 1, Wall 2, Wall 3.
Ideally i want to use this to weed out all of the walls in a project that match our standards and only report the ones that dont, so a project that has,say 100 wall types, i want to only see the ones that don’t comply to the BK or BR naming.


@Andrew_Harp use the same workflow shown by @Kulkul above, but set a watch node on the “in” output of the List.FilterByBoolMask output and you will see the results you are looking for :slight_smile:


As @awilliams Its just a matter of "True" or "False" Game :slight_smile:


True! :wink:


False! (Sorry had to).


Yep, so that works well. All good.

My issue here is that on a project, you might have 100 walls types. I don’t really want to have to type all of those into t a code block to be able to filter them. i am looking to use this across all projects,which may or may not have the same walls, using this code block, you would have to adjust for each project.

There must be a way to select all the walls using category or element and then filter out the ones that are correct.


And there is :slight_smile:

Thanks for all of your help. Much appreciated.


Hmm. So i have tried to expand this a little and it seems to have broken. It kind of works, but not really. It shows 3 walls that are not compliant, which is correct, but it is including a compliant one. I would expect to see Wall 1, Wall 2, Wall 3 but it is showing Wall 1, Wall 2, BR-1.10 (110 BR)


Try adjusting your list levels in the StartsWith node.


Change the lacing of the String.Starts with to cross product and then add a list.contains node with lacing set to longest looking for a ‘true’ input. That will produce 6 single depth true or false values which should be the mask for the Lost.FilterByBoolMask node.



This should work:


@Kulkul going old school with list map instead of lacing… I dig it!


Doesn’t look promising. I must be missing something.
dynamo 3


Try this:

AllFalse(L<1>) != true;

You typed it almost perfectly but the first 1 in your code is actually a lower case L.


Ahh, i see. thanks for that. Ill try it again.


OK, that still didn’t work. I’ll post a screen shot when I am in the office tomorrow.
I am finding this really frustrating at the moment. All I want to do is select all of my walls in a project and list the ones that don’t begin with certain alpha prefix. Why is this so hard to do?
I know that Dynamo is very powerful so why is performing a pretty basic task so difficult?
The way I see it, it should be 4 simple steps.

  1. select all walls (category)
  2. create a list
  3. find items that don’t meet a rule (Alpha prefix) and filter
  4. create a list of those items

This was supposed to be the first step in writing a script to audit files in a QA process but the time taken to get this first one working is really frustrating.


The search is only being done to the first 3 items. It’s easier to filter from “the other side” and try to lookup “walls”.If you want you cant still group all of them with the in and out. when u give a list of 6 items and search for 3 terms it will only look in the first 3. Therefore, Wall 1, Wall 2 and BR- … Try and do it for the “wall” search. If you want an advice, maybe try and filter with the “comments” section. And beware, u need another boolean mask for dynamo to know that that “list” is a list of elements (to get the green numbers so dynamo and Revit can interoperate constantly), and therefore, make all the changes you want


Don’t let the learning process get to you.

QA/QC scripts are hard to do as there are a TON of things that can put your script off the rails, and until you try out the easy stuff you don’t know what the issues are. Even seasoned Dynamo graphers go ‘oh I hadn’t thought of that possible issue’ as they work things like this out. The intent is to find stuff that’s been done in a not standard way. The addage ‘the universe will build a better idiot for your idiot proof system’ applies. Add in the fact that you’re relatively new to Dynamo (indicated by your not being familiar with the filter by bool mask node) and you’re in for some frustration.

But don’t let any of that dissuade you. Any of the seasoned users will tell you that he short term frustration is well worth the long term gains.

One way to get there faster is to revisit the Dynamo primer after you get this part of the overall process working. Be sure to do all the excercises, and revisit the ones you get confused by a second or third time. Also don’t be afraid to ask questions here - so long as you provide an updated screenshot people will be helpful.