# Points on 3D alignment line from centroid of all elements

**URL:** <https://forum.dynamobim.com/t/points-on-3d-alignment-line-from-centroid-of-all-elements/70989>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [December 2, 2021, 6:30am UTC](https://forum.dynamobim.com/t/points-on-3d-alignment-line-from-centroid-of-all-elements/70989 "2021-12-02T06:30:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![atharva.purohit466SX](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/atharva.purohit466sx/32/116951_2.png) [@atharva.purohit466SX](https://forum.dynamobim.com/u/atharva.purohit466SX)\
**Post date:** [December 2, 2021, 6:30am UTC](https://forum.dynamobim.com/t/points-on-3d-alignment-line-from-centroid-of-all-elements/70989/1 "2021-12-02T06:30:26Z")

</div>

Hello All,

What I’m trying to do here is to have points on a tunnel 3D alignment line from all the centroid of elements so as to get the chainage of that where that element is located?

Please find the below sketch for a visual explanation-

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

red x is element centroid  
black is alignment line  
blue is tunnel extents  
red circle are the points which I need to extract  
which is perpendicular from the element centroid. (closest point on alignment)

Please let me know if anyone have any approach or idea.  
Thanks in advance,

Regards,  
Atharva Purohit

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [December 2, 2021, 6:37am UTC](https://forum.dynamobim.com/t/points-on-3d-alignment-line-from-centroid-of-all-elements/70989/2 "2021-12-02T06:37:01Z")

</div>

Seems like the Geometry.ClosestPointTo node will solve this.

---

<div class="post-metadata">

**Author:** ![atharva.purohit466SX](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/atharva.purohit466sx/32/116951_2.png) [@atharva.purohit466SX](https://forum.dynamobim.com/u/atharva.purohit466SX)\
**Post date:** [December 2, 2021, 11:18am UTC](https://forum.dynamobim.com/t/points-on-3d-alignment-line-from-centroid-of-all-elements/70989/3 "2021-12-02T11:18:35Z")

</div>

Thank you for prompt reply Jacob!  
It worked.

Regards,  
ap

---

<div class="post-metadata">

**Author:** ![atharva.purohit466SX](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/atharva.purohit466sx/32/116951_2.png) [@atharva.purohit466SX](https://forum.dynamobim.com/u/atharva.purohit466SX)\
**Post date:** [December 10, 2021, 6:49am UTC](https://forum.dynamobim.com/t/points-on-3d-alignment-line-from-centroid-of-all-elements/70989/4 "2021-12-10T06:49:09Z")

</div>

Hi Jacob,  
will this method work with a polycurve?  
Actually i’ve a list of coordinates, and i’m trying to create a polycurve out of it so as to get a single curve and then use this method. But the points are coming very far. (by Geo.closPntTo)  
If you have some suggestion, it will be great!

Regards,  
ap

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [December 10, 2021, 8:10pm UTC](https://forum.dynamobim.com/t/points-on-3d-alignment-line-from-centroid-of-all-elements/70989/5 "2021-12-10T20:10:36Z")

</div>

Should work fine. If it fails you can post back here showing what is failing and I’ll see what I can do.
