List Create

Hi Everyone!
I want to create a new list with consecutive numbers from the previous list.
I need your help
image

Would list create help you here instead of list join ?

image

Hi @ingenieroahmad , Ohm No
My list already exists, I want to create a new list with consecutive numbers
image

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 :wink:

1 Like

Hi @ingenieroahmad,
I Try, but it is failed

Feed False as data type Boolean not as string … Remove " "

Like this?

1 Like

I Try, but it no success.

you might try also below python code

1 Like

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)
3 Likes

Great, that’s what I want,
Thank you very much