In Dynamo code block, can i return a variable input by Functions

Hi Sam.
I think I almost got it. Thanks to a post by @ Vikram_Subbaiah in Filter by Bool Mask - #5 by Batman86

Take a look.

The only challenges I have now are

  1. to clean the Empty list

  2. Arrange / Flatten the list in the format

  3. Get Back and pick the actual line rather than the vector from the boolean mask.

I would like to accomplish all these within the function.

Thanks in advance