List.Flatten vs Flatten?

What’s the different between List.Flatten and Flatten?
Because “Flatten” is not a standaard node in Dynamo.

Thanks in advance.

Fig-1

Fig-2

@j.boonen ,

looks like a old node …

https://dictionary.dynamobim.com/#/BuiltIn/Action/Flatten

in python you can flatten via double for loops

elements = [[[1,2,3],[4,5,6]]]
OUT = []

for i in elements:
    for x in i:
        OUT.append(x)
3 Likes

Thanks @Draxl_Andreas

But the nodes List.Flatten and Flatten doesn’t do the same?

What if the depth of list of lists is unknown?

1 Like

@j.boonen ,

than, is this “flatten” from a package ? which core do you use ?
i know just that

@Draxl_Andreas
Do you mean the following?

Fig-1

@j.boonen ,

yes… how about Flatten? is this from a package? maybe it is used for something else

As has been mentioned, Flatten is the old, now deprecated, version of List.Flatten. They do essentially the same thing, with the exception of List.Flatten allowing you to specify an amount to flatten by - kind of like a reverse list levels flattening from the outside in.

4 Likes

@Draxl_Andreas it’s from a script created in Revit 2018/2019.
I’m now working in Revit 2022.

1 Like