Remove Nulls, keep list structure and not have warning

Hi all!

I’ve made a script which needs to preserve its list structure. Snip below:

So, the 8, parameter values needs to be applied to the corresponding 8 elements that i’ve fed into the Element.SetParameterByName node. The script works perfectly fine, but, since there are nulls in element’s node, the Set parameter node throws a warning.

image

If i remove nulls and clean the list, the structure is lost and the parameters are not mapped to its corresponding elements. I’ve also tried to replace the nulls with an empty string " ". Still the same warning.

Is there a way to remove the warning? or perhaps change the lacing of the nodes so that, the warning is not shown and the structure remains intact?

This is purely an aesthetic issue. The script works fine otherwise.

Any help would be nice.

Thanks!

Hi @Dynamo_Noob,
You can try to filter out the nulls by using the List.FilterByBoolMask node as suggested in the image below.

The list structure would be lost but your parameter mapping would still stay mapped to its corresponding element.

3 Likes

hi Noob,

nulls are easy to replace using a simple formula, but empty list and multi-D lists require some more thought…
I normally replace nulls with false boolean, but it could be anything really, and your list will maintain its structure.

image

2 Likes

Using the same mask for both the lists. Thats smart!! it works!

Thanks a lot!

1 Like

Yes, but using that as well will show warnings in set parameter node i think.

Thanks a lot. This solution was very helpul.

1 Like