Hello everyone,
How can I sort a list in which it is taking two index and adding them to another list with a sequence, I want add them in a way that it takes two index at a time then remove the other index in the new list and take the next one , I couldn’t explain it by writing so there is a simple example to illustrate my purpose.
The blue List is the list I want to achieve , you can see that I want A,B to be with number1 , Then B & C with number 2 , then C &D With Number 3, IS there anyway I can achieve that ?
Thanks a lot
here you are:
list = IN[0]
seq = IN[1]
result = []
for i,s in enumerate(seq):
temp = [s,list[i], list[i+1]]
result.append(temp)
OUT = result
Hi newshunhk , Thanks A lot dear this is the way I want it exactly , but forgive me I don’t know how to insert a python script may I ask how did you get this Black screen that says python script ?
Hi, right click on the node:
Hello
I learn a lot of python with the posted messages
too
it’s good, I’m making progress.
Cordially
christian.stan
Thanks a lot Andreas this one also works but my script is way to big for now so I am trying to limit my nodes , again thanks a lot
Hi Christian this also works I tried this approach but I only have 1 , 2 , 3 as strings for example and A, B, C D , in the case you provided me I was always getting an E letter added out of no were do you for example how can we remove , it’s just out of knowledge I am trying learn as much as I can
Thanks
Hi Newshunhk how can I make the script work for 3 lists if I may ask ?
Hey draxl, how can i convert my theme black like you?
you mean this?
list1 = IN[0]
list2 = IN[1]
seq = IN[2]
result = []
for i,s in enumerate(seq):
try:
temp = [s,list1[i], list1[i+1], list2[i], list2[i+1]]
result.append(temp)
except:
pass
OUT = result
It is the default color from revit 2023.
Hi Again,
I mean that When I Have 3 lists it is only taking two and not adding The 3rd list into the script, I would only have two lists
I will try this now Christian ,
Thanks a lot man
Christian ,
My problem here is that two lists have 2 indexes and one list have 3 indexes maybe this would help you
Hi Newshunhk I don’t know if this would help , But I have a list with 3 index and two lists with 2 indexes I want to join the lists with the sequence, like before
can you show more on the left? see what are you feeding.