Clarification needed on C Python in Rhino8, list not recognized as list

R8, C Python script using rs.

rs.DivideCurveLength() output shows as Double[], even though it looks like a list of n elements, and cannot be sliced, for example listOfParameters[1:-1] gives an error. It sucks that we can’t use the output of the division function directly and have to rebuild the results into a list, but why is that ? Or maybe I’m doing something wrong, not a programmer meself.
Hmm, cannot upload images, keeps saying “sorry, an error has occured”.

@VIZIBLE

I am sorry for the frustration. You can easily convert the return Double[] to a native python 3 list using the list() function. Slicing would work on the native list.

I created a ticket to improve dotnet arrays and lists in Python 3 and support slicing.

RH-82702 Support slicing on dotnet arrays and lists

1 Like

Many thanks Ehsan ! Would be great to be able to use these outputs directly for such an example. I guess it can also be confusing for beginners.

Cheers,
F