Multiply a list made of text with a list made of numbers

revit
dynamo
listfilter

#1

Hi all,
I need a little bit of help doing some math between lists.

I have 2 lists, the first contains family names, the second one contains numbers, I need to produce a third list where the 1st item of the 1st list would be multiplied by the 1st number of the 2nd list, here an example:

As you can see in the image above, I need to “type” 3 times the Family A, 2 times the Family B and 1 time the Family C, so the new list should be like the one showed at the right of the image.

If anyone has a solution would be much appreciated :slight_smile:
Thanks


#2


I think this should solve it.
Do realize that the lacing of the List.TakeItems node is set to longest.


#3

List.OfRepeatedItems by itself will also work with levels and lacing set correctly.


#4

I tried those settings and it worked just fine, thank you guys for the quick help @JacobSmall @PauLtus


#5

Funny, I tried quite a lot of methods including directly sending it into that node but I somehow didn’t get it to work like that.


#6

What do you want to happen when the list length are not equal?
see image:
:wink:


#7

Thanks @Nico_Stegeman