Hi everyone,
I have trouble with lists order. As visible in the attachment I created 2 lists, the second one is divided in sublists with some of the same members of the first one.
I found the correspondent index of each sublist of list 2 in list 1 and then used the node List.insert (I’m not an expert so I looked for AddItemto front at index nut it doesn’t exist ah ah ah ).
I tried working on levels and lacing but still the resulting list is not the sum of the 2 as expected.
Some one has had similar probs? Or maybe could some one tell me where the mistake could be please?
(Of course this is just an example of the issue I have with the job, it’s way larger in amount but the criticity is in here)
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
list1 = IN[0]
list2 = IN[1]
listout = []
for i in list1:
for j in list2:
if i[0]==j[0]:
for ji in j:
i.append(ji)
else:
i = i
listout.append(i)
OUT = listout