# Sorting List of Pts & Conecting with line

**URL:** <https://discourse.mcneel.com/t/sorting-list-of-pts-conecting-with-line/96124>\
**Category:** Grasshopper\
**Created:** [February 8, 2020, 1:17pm UTC](https://discourse.mcneel.com/t/sorting-list-of-pts-conecting-with-line/96124 "2020-02-08T13:17:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![j.estevenssilva](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/j.estevenssilva/32/487407_2.png) [@j.estevenssilva](https://discourse.mcneel.com/u/j.estevenssilva)\
**Post date:** [February 8, 2020, 1:17pm UTC](https://discourse.mcneel.com/t/sorting-list-of-pts-conecting-with-line/96124/1 "2020-02-08T13:17:21Z")

</div>

Hello everyone,  
would like to ask some help achieving the following

 ![Idea](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/5/0/50a2a69c8f4142c6b0519bec3d2db313b9388138.jpeg) ![Code](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/8/9/894248ad32cc8d2f3ee09ec2a9fc2d40d71e4a2b.png)  
I thought to use If then else statment to filter objects with same X coordinate, but this doesnt seem to work. Any ideas would be very much appreciated  
thanks in advance

---

<div class="post-metadata">

**Author:** ![Jakinta](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jakinta/32/485854_2.png) [@Jakinta](https://discourse.mcneel.com/u/Jakinta)\
**Post date:** [February 8, 2020, 1:35pm UTC](https://discourse.mcneel.com/t/sorting-list-of-pts-conecting-with-line/96124/2 "2020-02-08T13:35:10Z")

</div>

One of many options is to create set from flattened pool of points (x-coordinate) and then branch them per same x. Later you just need to sort them on fitted circle for example and join them via polyline.

---

<div class="post-metadata">

**Author:** ![j.estevenssilva](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/j.estevenssilva/32/487407_2.png) [@j.estevenssilva](https://discourse.mcneel.com/u/j.estevenssilva)\
**Post date:** [February 8, 2020, 5:06pm UTC](https://discourse.mcneel.com/t/sorting-list-of-pts-conecting-with-line/96124/3 "2020-02-08T17:06:20Z")

</div>

Thanks Jakinta,  
could you be a bit more specific? I am relatively new to grasshoper (not to programing though) i am not yet so familiar with its data structures. Trees and branches are kind of novelty for me.

---

<div class="post-metadata">

**Author:** ![Jakinta](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jakinta/32/485854_2.png) [@Jakinta](https://discourse.mcneel.com/u/Jakinta)\
**Post date:** [February 8, 2020, 5:09pm UTC](https://discourse.mcneel.com/t/sorting-list-of-pts-conecting-with-line/96124/4 "2020-02-08T17:09:47Z")

</div>

Then you will have to upload file… here you can find detailed description how to do it…

> [@Help Us Help You](https://discourse.mcneel.com/t/how-to-ask-effective-questions/50034):
>
> Asking questions and getting answers is what this forum is all about. Although people are generally very helpful, there are things you can do to improve your chances of getting good and quick answers. Below you will find some suggestions, but don’t think of them as rules and especially don’t think of them as guarantees. 1. Choose a descriptive title for your post Don’t title your question Help! or I have a problem or Deadline tonight!, but actually describe the problem you are having. 2. Be s…

---

<div class="post-metadata">

**Author:** ![j.estevenssilva](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/j.estevenssilva/32/487407_2.png) [@j.estevenssilva](https://discourse.mcneel.com/u/j.estevenssilva)\
**Post date:** [February 8, 2020, 5:39pm UTC](https://discourse.mcneel.com/t/sorting-list-of-pts-conecting-with-line/96124/6 "2020-02-08T17:39:10Z")

</div>

[unnamed.gh](https://discourse.mcneel.com/uploads/short-url/o1bMcY3xx0j6KoMIVAdIpAI8Uod.gh) (22.0 KB) [Tests - GH.3dm](https://discourse.mcneel.com/uploads/short-url/42M7WlIx6DK1onjZMN22EDNwsJY.3dm) (356.7 KB)

 ![Input Parameters](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/b/1/b17f9fd65f168ab7be1380ad1b1951533f24b762.png)  
i made a confusion with the old files

---

<div class="post-metadata">

**Author:** ![Jakinta](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jakinta/32/485854_2.png) [@Jakinta](https://discourse.mcneel.com/u/Jakinta)\
**Post date:** [February 8, 2020, 5:39pm UTC](https://discourse.mcneel.com/t/sorting-list-of-pts-conecting-with-line/96124/7 "2020-02-08T17:39:27Z")

</div>

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/d/3/d34e720edb03006a8f7bef112d522b02f222feea.png)

[Sort-Join Points\_RE.gh](https://discourse.mcneel.com/uploads/short-url/tUb2thQpJWeJul8IGz938XhKh6U.gh) (14.7 KB)

---

<div class="post-metadata">

**Author:** ![j.estevenssilva](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/j.estevenssilva/32/487407_2.png) [@j.estevenssilva](https://discourse.mcneel.com/u/j.estevenssilva)\
**Post date:** [February 8, 2020, 5:44pm UTC](https://discourse.mcneel.com/t/sorting-list-of-pts-conecting-with-line/96124/8 "2020-02-08T17:44:23Z")

</div>

Thanks Jakinta.  
I wouldnt imagine it would be that simple. Thanks a lot

---

<div class="post-metadata">

**Author:** ![Jakinta](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jakinta/32/485854_2.png) [@Jakinta](https://discourse.mcneel.com/u/Jakinta)\
**Post date:** [February 8, 2020, 5:50pm UTC](https://discourse.mcneel.com/t/sorting-list-of-pts-conecting-with-line/96124/9 "2020-02-08T17:50:51Z")

</div>

Even simpler…

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/a/a/aaa8a5c142e7769fd1e6df99bfdfb54a88374b4f.png)

[Sort-Join Points\_RE\_2.gh](https://discourse.mcneel.com/uploads/short-url/3sjy5HUiJUylGCPVlTXRT8HTFUN.gh) (8.0 KB)
