# Separated lines into polylines

Dear all, I’m new to Grasshopper therefore many of you (if not all… ) will find this question a little silly…
I have a simple curve which has been split into segments. Some of the segments, shorter than a certain amount, have been ignored via a logical filter. As a result I have many separated lines each of which is made out of a number of simple segments. I need to join all these segments (composing each individual line) into single polylines (hence each line shall be a polyline and not a series of individual segments).

Is there any solution to this probably simple question ? And if I was to name these polylines incrementally like line_1, line_2 etc?

Thank you very much guys !

test segments into polylines.gh (17.1 KB)
test.3dm (296.8 KB)

You can extract the control points of the segments, cull duplicate points and create a polyline like this:

test segments into polylines.gh (29.2 KB)

Thank you for your reply but this is not quite what I wanted to achieve as by your method I only obtain one long polyline made of several control points : in fact I do not want to create à unique polylines but as many polylines as the separated lines.

To recap : 1. I have a long continuous curve. 2. I manage to split at joints location via “offset surface” item. 3. Define it further at some définition points via intersection events. 3. I have then multiple separated lines made of segments. 4. I want to convert these resulting separated lines into individual polylines.

Thank you !

Dear Martin thank for your prompt suggestion. I modified slightly my previous post to be clearer. May I ask you to attach you file please? thank you.

test segments into polylines.gh (30.2 KB)

Not sure but all you might have to do is join the edispatched segments.

Thank you Martin ! Yes effectively that is about what I wanted to do… pretty simple indeed.

This way the polyline will correspond to the series of segments.

Do you think there is also a way to name each polyline incrementally via à series like poly_1 poly_2 etc.

Thank you !

Many possibilities. I’d suggest using Elefront to work with attributes.

The file here creates simple text tags on each curve mid point:

test segments into polylines.gh (25.3 KB)