Combine values from two lists in a certain order


#1

Hi everybody!
I’m trying to combine the values from two lists (1+2) into a third list in a certain order for placing an adaptive component between two curves. My problem is that I can’t get the right order of the points (3):

0 from list 1 with 0 from list 2
1 from list 1 with 1 from list 2
and so on …

I’d be very thankful for any idea!


#2

Think the method you’re looking for is transpose :slight_smile:
More specifically… List.create -> list.transpose -> flatten :slight_smile: (keep an eye on your list levels)


#3

And what’s next? When I join them, the result ist the same :frowning:


#4

Show your attempt :slight_smile: it is much easier guiding you that way :slight_smile: as i have no pc near me atm :slight_smile:


#5

First step, input both lists into the same list.create node, next step, use list.transpose last step flatten the lists with list.flatten :slight_smile:


#6

Here’s a screenshot:

It’s still the same problem :frowning:
I think a sublist like the one below is necessary.


#7

Your issue is you are nesting your lists too deep, try cutting your two single ‘‘list.create’’ and pass the data directly to the list.create node with two inputs, what you want is two individual lists of data otherwise the list.transpose will have no effect :slight_smile:


#8

Great :slight_smile: You solved my problem. Thank you very much!
But there is a new one:

Any idea how to skip the diagonal ac’s?


#9

OK, I got it! It was the wrong offset:

Thank you very much Jonathan!


#10

Glad you figured it out :slight_smile:

Have a look at the output of the “List.Transpose” :slight_smile: It should be what you actually want as input to your points, saving you 3 nodes :slight_smile:


#11

That’s Right. Thank you for your hint :slight_smile: