Read specific elements from a list

#1

Hi dynamo community!

I have a question that seen to be simple but I am not able to resolve, here it goes:

I have a list of values taking from revit of different heights. I want to read just some of the values, in this case I am interested in the values that are different than 200.

I thought to use a filter by bool mask to take the values but the it changes the order of the elements (It put first the true values and then the false ones) If that happen, It is not possible to use the list later on because the order has changed. I don’t know how to do it

Thank you in advanced ;D

0 Likes

#2

Filter does what it says: it filters (narrows down) your list. But what is it that you want?

0 Likes

#3

@celia.ramaj only one of those lists will come out of the “in” and another out of “out”. What are you trying to do?

0 Likes

#4

Oh btw: if you want the elements filter by those who have a parameter value of 200:

Connect the list of List.FilterByBoolMask to Elements list (the same you use at Element.GetParameterValueByName).

0 Likes

#5

If you only want values of 200 but want to keep list structure (returning all other values as blank) you can use an IF statement.

x==200?x:""

1 Like

#6

And the inverse statement would also hold value.

x != 200 ? x : ““;

1 Like