Select all element on a reference level

Hello,
i’m trying to select all the elements in which the parameter “reference level” (italian traduction “livello di riferimento”) is equal to L21. I can’t find the mistake.

I have many objects in my project but only some of them belong to level 21, I would like to create two lists that divide them into those belonging to level 21 and those that do not belong to level 21

You have to filter with List.Contains or String.Contains. This is an example with Rooms:

1 Like

Hi luca,
thanks for your answer
I’ve try to filter by list and string but something wrong.
I tink that is better to use List.Contains, but maybe the problem is that i’m working with reference level and not with classical Revit Levels.

If you use List.Contains you probably have to connect directly Levels and List.Contains, otherwise you get strings instead of levels. Also maybe you need Cross Product Lacing.

If you use String.Contains you might need to add a Parameter.Name node after Element.GetParameterValueByName.

Hi @Alessio4Polito

You where trying to filter elements based on “reference level” where as @lucamanzoni was trying to show you how to filter by “Level” which in his case was string. However to filter by reference level here is one of the possible way:

3 Likes

Thank you all for the advices, I appreciate very much.
I solved my problem in this way
i needed to write a text into a parameter wich is linked to a reference level and I make this script, I use this in the 3D view of the project. So I can analize different category of object in my project all togheter.

Thank you

Hi, yes this works for room but when i use it for structural elements become error, how can i make filter for structural elements and used them in the views

thanks