List Create

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

here is a solution with Python

import sys
import clr
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]:
		lst = [i for i in lst if i not in grouplst]
		return [grouplst] + splitBySequence(lst)
		return []
OUT = splitBySequence(lst)

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