Manage level (layer ?) of sublist from the right side of the list

Hello,

I don’t have the words to explain what I expecte, I passed time to try and don’t find good keyword to resolve my problem. A screenshot should be better than a long speach.


List.dyn (18.0 KB)

Here the code for exemple, on the list to insert null values can be an integer.

//Go to ...
[1..4..1,0..5,1];
//List to insert
[null,[10..11],null];
//Aim
[[1..4..1],[[10],[11],0..5],[11]];

If you have an idea

It’s confusing. I think you can get an answer easily if you clarify your question.

  1. What you have for input
  2. The logic you think
  3. Desired output

Normalize depth?

An idea:

  • List.Clean to get rid of the nulls - just pass an empty list.
  • List.Insert - add the sublists into the list at index 0. This will mess up the levels, but just for a moment.
  • List.Flatten with the list input to @@L3 to get the desired structure back.

Finally, I found when I inserted these nodes because I found a mistakes on my initial script.

What you have for input
I optimise welded mesh from my model with bin pack nodes from Refinery Toolkits

The logic you think
I take all the uncut welded mesh at the top of the list followed by the cut welded mesh

Desired output
I wanted the uncut welded mesh to front list to get a graphic, when I inserted these nodes I found a mistakes that resolved my problem
So Refinery Toolkits don’t sort results, I just take the output

Thank you for your help

2 Likes