Override (shared) family type parameter based on filter

Hello,

We are trying to fill a shared (yes/no) family type parameter if no value to for example ‘yes‘.
It is listing the 3 values in my project as 1, 0 and ‘no value‘ already. And I want to set parameter.

What should be the missing steps, to filter elements with ‘no value‘ and input to set value.

Like to hear from you,

  1. Test the parameter values for being equal to no value (alternatively not being equal to 0 or 1).
  2. Filter out the elements (from unique items) according to the boolean list from the test (step 1).
  3. Element.SetParameterValueByName for each of “in” elements (should only be one in this case) to set the same parameter name to your desired value.

Thanks you for your quick reply, Jacob. My level is novice so i’m probably understanding some wrongly.
Two questions:

  • I tried ‘List.filterByBoolMask‘ but gives for me unexpected outcome. What should I put in the string to make it filter out ‘1‘, ‘0‘ and leaving ‘no value‘ as output.
  • For the one wall (element) selected, it gives an warning message.
    Maybe due to the fact I’m listing one element to change Family Type parameter.
    Would it work if I got all wall selected, or does it require a different setup

List.Contains needs an integer in your case and your feeding a string by the looks of it.

Convert your integer to a string

OR

…feed an intteger to your List.Contains.

You’re quite close.

List.Contains will tell you if anywhere in the list the object is returned, and then give you a single boolean (true for false).

You likely want to test something like “is the value not equal to 1”, filter out and then set all values (those at 0 or left blank) to 0 (so values already 0 are made zero and values blank are made zero). To test equality, use the equal (==) node. To test inequality use the not equal (!=) node.