Filter elements not working

I’m trying to filter elements, which should be a simple straight forward process. Unfortunately, I’ve tried different methods but none of them seemed to work. First of all I tried filtering elements on a certain level, however the equal node returned all false.

next, I tried adding a string in the type comments parameter to make the elements that I want to select unique. Also here, the element get parameter value by name node returned blank.

Finally I tried to filter by family type. In this case the get parameter value by name does return the family types, but when I try to extract the proper filter using the equal node, it returned everything as false.

I’m a newbie so I must be doing something wrong.

Hi @robertobatista,

If you use the “==” node the text in your codeblock has to be the same as the output of the “Element.GetParameterValue” node if you want a true value.
An other option would be to use for example the String.Contains node (instead of ==).

Kind regards,
Mark

I used also the get.parameter with the comment section. I think you should get rid of the “Type” word and just use comments. If you mark them, then you can Get.Parameter and filter them with the FilterBoolean using an empty string. What I mean is going the other way, instead of filtering the elements with comments, filter the elements WITHOUT comments and get the list from the “out” input.


Hope it helps

Level and Type will both return the actual Level and Family Type elements, not a string. You need to get the name of those elements before using == to check for values.

If Type Comments is a type parameter, you won’t be able to use the standard GetParameterValue node with the family instances. You’ll either have to get the Family Type of each instance or use a custom node than can handle both type and instance parameters.

1 Like

Hi @robertobatista,

@Nick_Boyts is right if you want to filter by Level or Type you first have to turn it into a string.
In the below examples i used a “String from Object” node for this purpose.

I hope it helps to solve your problem.

Kind regards,
Mark

Converting each step to a string seems the be the answer. In my case, I’ve filtered the generic model families by type name, then filter it by level, both using the string by object nodes.

Thank you very much!!!

Hi @robertobatista,

If you think this is the answer to your question, please mark this post as solved (so others can also benefit from it).

ProblemSolved

Kind regards,
Mark