# Divide a list of points to create multiple polylines

**URL:** <https://discourse.mcneel.com/t/divide-a-list-of-points-to-create-multiple-polylines/69382>\
**Category:** Grasshopper\
**Created:** [August 23, 2018, 4:10pm UTC](https://discourse.mcneel.com/t/divide-a-list-of-points-to-create-multiple-polylines/69382 "2018-08-23T16:10:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cokerone1214](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/cokerone1214/32/149798_2.png) [@cokerone1214](https://discourse.mcneel.com/u/cokerone1214)\
**Post date:** [August 23, 2018, 4:10pm UTC](https://discourse.mcneel.com/t/divide-a-list-of-points-to-create-multiple-polylines/69382/1 "2018-08-23T16:10:10Z")

</div>

Hi all!

I have a number of points and I want to create closed polylines in each 4 points. For example one polyline by points ( 0,1,2,3 ), the next polyline by points ( 4,5,6,7 )… I suppose that I have to divide my list of points by 4.

Any idea how can I achieve that?

Thanks in advance!

[polylines.gh](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/0/4/0490eb3d171236046ebf01b7a0562fc673561889.gh) (7.5 KB)

---

<div class="post-metadata">

**Author:** ![emerson.porras](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/emerson.porras/32/520442_2.png) [@emerson.porras](https://discourse.mcneel.com/u/emerson.porras)\
**Post date:** [August 23, 2018, 4:24pm UTC](https://discourse.mcneel.com/t/divide-a-list-of-points-to-create-multiple-polylines/69382/2 "2018-08-23T16:24:59Z")

</div>

![Canvas%20at%2011%3B23%3B40](https://global.discourse-cdn.com/mcneel/original/3X/2/a/2a8e07c76c023e7013d019809450307e6432cd89.png)

---

<div class="post-metadata">

**Author:** ![cokerone1214](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/cokerone1214/32/149798_2.png) [@cokerone1214](https://discourse.mcneel.com/u/cokerone1214)\
**Post date:** [August 23, 2018, 4:29pm UTC](https://discourse.mcneel.com/t/divide-a-list-of-points-to-create-multiple-polylines/69382/3 "2018-08-23T16:29:22Z")

</div>

Thank you Emerson!!

---

<div class="post-metadata">

**Author:** ![HS\_Kim](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/hs_kim/32/473975_2.png) [@HS\_Kim](https://discourse.mcneel.com/u/HS_Kim)\
**Post date:** [August 23, 2018, 4:30pm UTC](https://discourse.mcneel.com/t/divide-a-list-of-points-to-create-multiple-polylines/69382/4 "2018-08-23T16:30:49Z")

</div>

For data matching, it would be better not to use flatten in the middle of your process.

 ![Canvas%20at%2001%3B24%3B54](https://global.discourse-cdn.com/mcneel/original/3X/d/9/d908ca6860fb9f823643b36291d2885e25240591.png) [polylines\_re.gh](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/5/c/5c0905fb706bc66aab2ab4eb4e073d55c224a5aa.gh) (9.5 KB)
