Python list of lists to a 2nd python component


example script (13.5 KB)

I have a python component that takes a big bag of points and sorts them into a list of lists of points.
This is passed to a second python component (Guilo’s) that turns the list of lists into a data tree.

I want to add an intermediate component that crops some of the points out. I can add this inside the first python component (and have an example in the first component that runs), but it’d be better practice to modularize. It appears a python component can’t process an input list of list of points? Giving it list access means that the top level list works, but the next level down is a guid, not the python list itself. How do I get from guid to the data?

OR Do I need to convert list of lists to a tree, give the new python component tree access, and then work within the tree data structure?

How do I get from guid to the data?

pt = rs.coerce3dpoint(guid)

It works, but dosen’t result in a point, am I mistaken, am I not looking at a GUID then?

Interesting, I didn’t experience it before.

Most of the time when I have list of lists of points I return it just like you do, and then I use C# component with “A = x;” line, so it converts list of lists to tree. Later I take the tree, but as much as I can I avoid to analyze the tree as the tree, so I if I can I analyze it as list. Only when I really have to: I plug the tree as an input and then access it as an tree.