im trying to recreate a workflow that used gh components in a single python node.
import rhinoscriptsyntax as rs import ghpythonlib.treehelpers as th import scriptcontext as sc # import Rhino seq = [x * dist + dist for x in range(count)] intervals = [(x - dist, x) for x in seq] def groupByPosition(pairs): newpairs = [[y for y in pairs if min(x) < y < max(x)] for x in intervals] return sorted(newpairs, key=lambda x:x) srfpairs = [[x, rs.SurfaceAreaCentroid(x)[axis], str(x)] for x in srfs] print(srfpairs) b = th.list_to_tree(groupByPosition(srfpairs)) a = srfs
it basically takes in a bunch of referenced surfaces made from a imported cad file and sorts them by position, or its titleblock position. however i need the output to maintain its layer information, since the output are just geometry. i had a feeling scriptcontext might help, but still trying to wrap my head around it. my desired result would be this python node to act as a sorting mechanism, like how standard components do. I would appreciate any help in achieving this.