Hi Everyone!
I want to create a new list with consecutive numbers from the previous list.
I need your help
Would list create help you here instead of list join ?
Hi @ingenieroahmad , Ohm No
My list already exists, I want to create a new list with consecutive numbers
Difficult to say, could you show the entire graphs??
Hi @sovitek , Thanks for your answer.
I want to create a new list from the False Lists is between the two True lists.
Try (Groupbykey) node and feed key by true or false.
1 Like
Yep, ingenieroahmad would say the same
1 Like
Hi @ingenieroahmad,
I Try, but it is failed
Feed False as data type Boolean not as string … Remove " "
Hello
here is a solution with Python
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
lst = IN[0]
def splitBySequence(lst):
if lst:
grouplst = [lst.pop(0)]
for i in lst:
if i -1 == grouplst[-1]:
grouplst.append(i)
lst = [i for i in lst if i not in grouplst]
return [grouplst] + splitBySequence(lst)
else:
return []
OUT = splitBySequence(lst)
4 Likes
Great, that’s what I want,
Thank you very much