# Reporting a length of a an adaptive curve / spline using dynamo

**URL:** <https://forum.dynamobim.com/t/reporting-a-length-of-a-an-adaptive-curve-spline-using-dynamo/23817>\
**Category:** Revit\
**Created:** [July 17, 2018, 11:25am UTC](https://forum.dynamobim.com/t/reporting-a-length-of-a-an-adaptive-curve-spline-using-dynamo/23817 "2018-07-17T11:25:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![infoZ9HS2](https://avatars.discourse-cdn.com/v4/letter/i/f07891/32.png) [@infoZ9HS2](https://forum.dynamobim.com/u/infoZ9HS2)\
**Post date:** [July 17, 2018, 11:25am UTC](https://forum.dynamobim.com/t/reporting-a-length-of-a-an-adaptive-curve-spline-using-dynamo/23817/1 "2018-07-17T11:25:50Z")

</div>

Hi,

I came across a Revit question on the autodesk froum where i am experiencing the exact same problem as the previous user:

[https://forums.autodesk.com/t5/revit-architecture-forum/reporting-length-of-a-spline/td-p/6675780](https://forums.autodesk.com/t5/revit-architecture-forum/reporting-length-of-a-spline/td-p/6675780)

In it there is mention of using Dyanmo to determine the length which i am also unfamiliar with but want to use it to find a solution. When i create the script shown by @Alfredo Medina I am getting a blank document at the other end and something is wrong. Could someone go into a little more detail please of the steps required and explain where I may be going wrong. I would like it to output the information as a schedule for all of the different sizes.

I have also put this question on the revit forum with files attached if you wiah to download them as i cannot do it here:

[https://forums.autodesk.com/t5/revit-architecture-forum/reporting-a-length-of-a-an-adaptive-curve-spline-using-dynamo/td-p/8134624](https://forums.autodesk.com/t5/revit-architecture-forum/reporting-a-length-of-a-an-adaptive-curve-spline-using-dynamo/td-p/8134624)

Many thanks

Liam

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [July 17, 2018, 12:25pm UTC](https://forum.dynamobim.com/t/reporting-a-length-of-a-an-adaptive-curve-spline-using-dynamo/23817/2 "2018-07-17T12:25:43Z")

</div>

Hi @infoZ9HS2,

You need to deconstruct the family to get the edge curves.

 ![Curve%20length](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/0/90abc400c5e7d2de1eb01fc23a4e9a88ba38d60f.png)

 ![Lenght%20curve](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/e/5edbca1cf460d6aa59f9e292b7bf7d48ec655786.PNG)

Alfredo Medina’s graph works with a spline not with a family.

---

<div class="post-metadata">

**Author:** ![infoZ9HS2](https://avatars.discourse-cdn.com/v4/letter/i/f07891/32.png) [@infoZ9HS2](https://forum.dynamobim.com/u/infoZ9HS2)\
**Post date:** [July 17, 2018, 3:12pm UTC](https://forum.dynamobim.com/t/reporting-a-length-of-a-an-adaptive-curve-spline-using-dynamo/23817/3 "2018-07-17T15:12:41Z")

</div>

Thanks Alban,

I have written the script but am getting 2 errors saying:

Code Block: Warning: The index is outside the given range.

CSV.WriteToFile: Warning: CSV.WriteToFile operation failed.

I think i understand all of the nodes apart from List Sort, Code Block & Watch could you explain these a little please and also what i need to do to make the script work?

Also what type of file must the output file be or is this automatically generated (no file selected) if one is not selected?

Thanks

Liam

---

<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:** [July 17, 2018, 4:07pm UTC](https://forum.dynamobim.com/t/reporting-a-length-of-a-an-adaptive-curve-spline-using-dynamo/23817/4 "2018-07-17T16:07:44Z")

</div>

@infoZ9HS2 See if this helps…

 ![curveLength](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/9/098df37d3cb7b5a80161d4939a82fc85d9af92e7.png)  
[curveLength.dyn](https://forum.dynamobim.com/uploads/short-url/4KVgCsgRuNdgQi8BHPJ3F8XRdCK.dyn) (11.1 KB)

> [@infoZ9HS2](#):
>
> Also what type of file must the output file be or is this automatically generated (no file selected) if one is not selected?

You’ll need to create a blank .csv file and specify the path.

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [July 17, 2018, 8:55pm UTC](https://forum.dynamobim.com/t/reporting-a-length-of-a-an-adaptive-curve-spline-using-dynamo/23817/5 "2018-07-17T20:55:15Z")

</div>

> I think i understand all of the nodes apart from List Sort, Code Block & Watch could you explain these a little please and also what i need to do to make the script work?

To explain the logic :  
List.sort was to get an order from the list of edges and find the next to last highest value.  
The code block is simply a GetItemAtIndex in DesignScript language.

In any case, Vikram Subbaiah’s graph is better because it finds the length of the “axis” of the family and not that of an edge.  
So please marks his post as solution to facilitate similar researchs in the future.

 ![Curve%20lenght](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/1/11e74228c144ae3ad6cbf6c750a5052ff97f71ad.png)

---

<div class="post-metadata">

**Author:** ![infoZ9HS2](https://avatars.discourse-cdn.com/v4/letter/i/f07891/32.png) [@infoZ9HS2](https://forum.dynamobim.com/u/infoZ9HS2)\
**Post date:** [September 4, 2018, 3:13pm UTC](https://forum.dynamobim.com/t/reporting-a-length-of-a-an-adaptive-curve-spline-using-dynamo/23817/6 "2018-09-04T15:13:04Z")

</div>

Finally gotten arond to testing this and it works great. Thanks so much Vikram. Thge only issue is last node: Data.ExportCSV is not in the library? Any ideas where it may be? Or an alternative?

Thanks

Liam

---

<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:** [September 4, 2018, 3:50pm UTC](https://forum.dynamobim.com/t/reporting-a-length-of-a-an-adaptive-curve-spline-using-dynamo/23817/7 "2018-09-04T15:50:05Z")

</div>

> [@infoZ9HS2](#):
>
> Data.ExportCSV is not in the library?

Apparently you are using an old version. This is available in ver 2

In 1.3, the equivalent node is …  
 ![csv1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/a/5af6e5f8264ebf2d2869eabe15bc2b12fbc6fa62.png)

---

<div class="post-metadata">

**Author:** ![infoZ9HS2](https://avatars.discourse-cdn.com/v4/letter/i/f07891/32.png) [@infoZ9HS2](https://forum.dynamobim.com/u/infoZ9HS2)\
**Post date:** [September 12, 2018, 3:42pm UTC](https://forum.dynamobim.com/t/reporting-a-length-of-a-an-adaptive-curve-spline-using-dynamo/23817/8 "2018-09-12T15:42:57Z")

</div>

OK so i have downloaded the latest veriosn and it works great. The only other element i would like to introduce is to give each sheet a mark. How do I make dynamo report on this? Thanks!
