Extraction of coordinates from a list (text & data)

Hello everyone,

I am currently working on a project where I need to extract coordinates from a list containing both text and data. Having not found a satisfactory solution with Grasshopper components, I am exploring the possibility of developing a Python component. However, as a novice in programming, I am facing difficulties. Do you have any advice or assistance to offer?

Thank you in advance for your help.

Best regards,


teste 1.gh (12.6 KB)

You’re probably going to have to be a bit more explicit about what to extract and how it ought be formatted. But here’s a quick go at extracting all the floats at lines that start with Position as a DataTree:


240215_ExtractPositionFloats_00.gh (13.3 KB)

1 Like

Ah, you’re absolutely right, I apologize for the confusion. I’ll make sure to be clearer next time. Thank you very much for your assistance! :slight_smile:

1 Like

Hello again,

Thank you for your assistance thus far. I have a follow-up regarding the code you provided earlier. It performed well, but because i thought the problem more simple that it realy is,

I’m encountering difficulty adapting it to my current situation.

To clarify my objective, I’m attempting to track the movement of particles. My aim is to draw a line from their initial position to their final location in the simulation. To accomplish this, I need to retrieve the coordinates labeled “position.”

Apologies for reaching out again. I hope my explanation makes sense. I appreciate your ongoing help!


teste 2.gh (22.9 KB)

I’m afraid I can’t run your definition:

But if I understand the problem correctly, you can make points from the positions within the search loop and draw a polyline through these. To get the start/end positions you can get the polyline endpoints:

240215_ExtractPositionFloats_01.gh (14.7 KB)