Dynamo List Zip node / method?

Does anybody know of a simple Dynamo node that does the same as Python List.Zip function?
Or how to do it most efficiently with custom nodes?

list1 = (‘one’, ‘two’, ‘three’)
list2 = (‘1’,‘2’,‘3’)

zip(list1,list2) = ((‘one’, ‘1’), (‘two’, ‘2’), (‘three’, ‘3’))

Edit: Simple Python works, but interested in the Dynamo way…
OUT = zip(IN[0],IN[1])

I think that using shortest lacing does the trick.
A lot of custom nodes are unfortunately badly written and simply may not support lacing. Nodes written in Python surely won’t support lacing either. But if I remember correctly - archilab nodes do support it.

2 Likes

In design script:
List.Transpose([ListA,ListB]);

In node form: List.Create and List.Transpose nodes. No lacing or list level issues with the data structure you posted.

If you have a more real example of a node you want to do this with please post the image showing the first list, the second list, and the node in question and we can help out.

1 Like