# Dividing polycurve by distance

**URL:** <https://forum.dynamobim.com/t/dividing-polycurve-by-distance/8039>\
**Category:** Uncategorized\
**Created:** [December 7, 2016, 12:35am UTC](https://forum.dynamobim.com/t/dividing-polycurve-by-distance/8039 "2016-12-07T00:35:38Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Hannell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andrew_hannell/32/103315_2.png) [@Andrew\_Hannell](https://forum.dynamobim.com/u/Andrew_Hannell)\
**Post date:** [December 7, 2016, 12:35am UTC](https://forum.dynamobim.com/t/dividing-polycurve-by-distance/8039/1 "2016-12-07T00:35:38Z")

</div>

Hello

I am working on a model for a segmental tunnel- it is based on an alignment string in CAD i.e. a 3D polyline that defines the path.  
The process I have used so far (and it works) is:

1. Divide the alignment string in Rhino or Civil3D at specific intervals and export to CSV. (Rhino is the quickest & has best results)
2. Read the CSV file using Dynamo and insert adaptive family between points.

Rather than using Rhino/CAD to genetrate the points, I am trying to do it all in Dynamo- my process is:

1. Select CAD import in Revit
2. Extract the geometry (a polycurve consisting of multiple curves)
3. Create a new NurbsCurve through the points of the curves
4. Divide the NurbsCurve by distance (necessary because Curve.DivideCurveByDistance will not work on a polycurve)

The problem is that the divisions start off correctly (should be 1700mm)- but then increases before going back to the defined distance  
You can see this in the vector lengths and also the model.

So the question is essentially how to divide a polycurve by a specific distance  
thank you

Andrew

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/c/9c0b8feae7a0b22845a3701418cea3b10653731b.JPG)  
 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/2/02b9592918f56dd4ac6f80182e12a1fff0da3722.JPG)  
 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/d/2d99a69dfca9d20b7b397919262d4649b55274be.gif)

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [December 7, 2016, 2:25am UTC](https://forum.dynamobim.com/t/dividing-polycurve-by-distance/8039/2 "2016-12-07T02:25:06Z")

</div>

@Andrew_Hannell See if this works for you.  
 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/6/f66606e669dde9c6c41c5041594fedb78c0ef2de.png)

---

<div class="post-metadata">

**Author:** ![Andrew\_Hannell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andrew_hannell/32/103315_2.png) [@Andrew\_Hannell](https://forum.dynamobim.com/u/Andrew_Hannell)\
**Post date:** [December 7, 2016, 3:22am UTC](https://forum.dynamobim.com/t/dividing-polycurve-by-distance/8039/3 "2016-12-07T03:22:40Z")

</div>

@Vikram_Subbaiah

Wonderful, thank you very much Vikram.

This means 22km of twin tunnels can be modelled in about 5 minutes, complete with sequentially numbered rings.  
(It took someone about 6 months to manually model a similar project…)

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/3/3356196365ae7de60e3fab3e7a23e18de11c54c8.gif)

Andrew

---

<div class="post-metadata">

**Author:** ![jostein\_olsen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jostein_olsen/32/8570_2.png) [@jostein\_olsen](https://forum.dynamobim.com/u/jostein_olsen)\
**Post date:** [December 7, 2016, 6:55am UTC](https://forum.dynamobim.com/t/dividing-polycurve-by-distance/8039/4 "2016-12-07T06:55:48Z")

</div>

Hopefully you don’t get paid by the hour, Andrew…😉

---

<div class="post-metadata">

**Author:** ![Andrew\_Hannell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andrew_hannell/32/103315_2.png) [@Andrew\_Hannell](https://forum.dynamobim.com/u/Andrew_Hannell)\
**Post date:** [December 7, 2016, 8:23am UTC](https://forum.dynamobim.com/t/dividing-polycurve-by-distance/8039/5 "2016-12-07T08:23:57Z")

</div>

should get paid by the anti-hour…!  
(i.e how much time saved)

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [December 7, 2016, 8:29am UTC](https://forum.dynamobim.com/t/dividing-polycurve-by-distance/8039/6 "2016-12-07T08:29:50Z")

</div>

And redistribute to all this excellent people that worked for free ? 😌

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [December 7, 2016, 9:28am UTC](https://forum.dynamobim.com/t/dividing-polycurve-by-distance/8039/7 "2016-12-07T09:28:23Z")

</div>

Don’t forget me 😄 😄

---

<div class="post-metadata">

**Author:** ![emily.wood](https://avatars.discourse-cdn.com/v4/letter/e/7bcc69/32.png) [@emily.wood](https://forum.dynamobim.com/u/emily.wood)\
**Post date:** [March 20, 2019, 7:08pm UTC](https://forum.dynamobim.com/t/dividing-polycurve-by-distance/8039/8 "2019-03-20T19:08:06Z")

</div>

All,

I’m currently working on a script with the intention of segmenting curves. The goal is to divide curves into line segments of a set distance. I found the script above to be quite interesting, but I cannot seem to find the Curve.DividePolyCurve node in my lunchbox package, and I have the latest version available. Can anyone tell me where I may find that command? or have any useful tips for a script like this?

Thanks!

---

<div class="post-metadata">

**Author:** ![Andrew\_Hannell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andrew_hannell/32/103315_2.png) [@Andrew\_Hannell](https://forum.dynamobim.com/u/Andrew_Hannell)\
**Post date:** [March 23, 2019, 9:57am UTC](https://forum.dynamobim.com/t/dividing-polycurve-by-distance/8039/9 "2019-03-23T09:57:34Z")

</div>

Hi Emily

DivideCurveByDistance is still in Lunchbox  
(but note the current version is a non-package manager install)  
Depending what kind of geometry it is, some of the above techniques might still be relevant/necessary

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/f/ff0dcdac9073b8c9578ed78c1f3320de86edd7c0.png)

---

<div class="post-metadata">

**Author:** ![Daan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daan/32/82246_2.png) [@Daan](https://forum.dynamobim.com/u/Daan)\
**Post date:** [October 10, 2019, 1:11pm UTC](https://forum.dynamobim.com/t/dividing-polycurve-by-distance/8039/10 "2019-10-10T13:11:55Z")

</div>

Holy shit this approach also worked for me with a similar problem!!

---

<div class="post-metadata">

**Author:** ![Dhet](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@Dhet](https://forum.dynamobim.com/u/Dhet)\
**Post date:** [December 17, 2019, 9:56pm UTC](https://forum.dynamobim.com/t/dividing-polycurve-by-distance/8039/11 "2019-12-17T21:56:21Z")

</div>

Edit: Thank you for the help thus far!

I’m looking to do something similar here. I simply want to array parking stalls along a path. I’m currently trying to bind a few different methods together to get the stalls placed every 9’-0" while also getting them to rotate tangentially with the points they are placed on. What I currently have seems fine, but I’m wondering how to place the stalls every 9’-0" rather than dividing the total length of the polyline by 9. Not sure which way is better.

In addition to this i’d like to have the ability to flip the stalls 180 degrees along the polyline if the parking lot is on the other side of it. I’d like to do this with a toggle in the Dynamo Player if possible.

 ![Parking Array](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/a/eacac3674f60e28326aaaf47b95ee5cbe0d102b0.jpeg)
