Select by Layer / Convert Guid to Geometry in Grasshopper

I have been working on a simple script for some time now in Python that would separate all the curves by layers. It seems, however, that the output curves are not the same curves as the input curves. Despite the fact they are called “Referenced Line-like Curve”, they cannot be used as geometry in GH anymore.

Even if I just send through the input curves to the output without any modification, they still appear to loose their “referenced” type.

I have attached the gh and rhino files.

Do you you why the curves becomes texts and are not recognised as geometry? How can a ‘Guid’ be converted to ‘Curve’ that can be used in Grasshopper after as geometry? Is there a way to work with the curves directly without any conversion? Your help would be much appreciated. Thanks a million,

Select by Layer.3dm (25.0 KB) Select by (7.8 KB)

im not sure if this helps much, but this is how i just handled a similar issue myself. it does sort curves based on layer names, and keeps the reference. hope this helps.

Select by (17.5 KB)

Thanks, Tkahng!

This worked for me. I have found the Elefront plugin that has a “Filter by Layer” component which also does the trick.

Many thanks.