# Getting the centroid of the pipe

**URL:** <https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349>\
**Category:** Geometry\
**Created:** [December 13, 2017, 7:42am UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349 "2017-12-13T07:42:07Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdulrahman\_Qasem](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Abdulrahman\_Qasem](https://forum.dynamobim.com/u/Abdulrahman_Qasem)\
**Post date:** [December 13, 2017, 7:42am UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/1 "2017-12-13T07:42:07Z")

</div>

how to get the centroid point of pipe ?

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [December 13, 2017, 3:06pm UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/2 "2017-12-13T15:06:04Z")

</div>

Please explain what you’ve attempted so far. There are standard nodes for this.

> [@How to get help on the Dynamo forums](https://forum.dynamobim.com/t/how-to-get-help-on-the-dynamo-forums/4677):
>
> One of the main goals of the Dynamo community is to help others. One way to do that is by answering your questions. But to get the right answer, you’ll first have to ask your question in the right way. 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 on how to achieve that. Do not think of these suggestions as rules and especially do not take them as a guarantee of getting an an…

---

<div class="post-metadata">

**Author:** ![Abdulrahman\_Qasem](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Abdulrahman\_Qasem](https://forum.dynamobim.com/u/Abdulrahman_Qasem)\
**Post date:** [December 13, 2017, 3:12pm UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/3 "2017-12-13T15:12:57Z")

</div>

i need to get the centroid point of a pipe exist in revit, or a point at bottom of pipe surface

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [December 13, 2017, 3:13pm UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/4 "2017-12-13T15:13:52Z")

</div>

Can you show us what you’ve attempted? Have you searched the Dynamo library for any nodes you might need?

---

<div class="post-metadata">

**Author:** ![Abdulrahman\_Qasem](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Abdulrahman\_Qasem](https://forum.dynamobim.com/u/Abdulrahman_Qasem)\
**Post date:** [December 13, 2017, 3:26pm UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/5 "2017-12-13T15:26:03Z")

</div>

![geom](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/0/20a1ab1f31ac6a30be88c8483764e4df857e511b.jpg)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [December 13, 2017, 3:30pm UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/6 "2017-12-13T15:30:35Z")

</div>

Are you trying to get all elements of the same type as your selected element? You’d have to get the family type of your selected element then use All Elements of Family Type.

Element.Geometry will return solids for any solid geometry, so you don’t need to convert to polysurfaces either.

---

<div class="post-metadata">

**Author:** ![Abdulrahman\_Qasem](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Abdulrahman\_Qasem](https://forum.dynamobim.com/u/Abdulrahman_Qasem)\
**Post date:** [December 13, 2017, 3:34pm UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/7 "2017-12-13T15:34:14Z")

</div>

all what i need is to get the point of centroid or even a point at bottom of pipe

is that possible ?

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [December 13, 2017, 3:42pm UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/8 "2017-12-13T15:42:32Z")

</div>

Both are possible. Getting the centroid is as easy as getting the element geometry and using Solid.Centroid. Getting the bottom of pipe is a little more involved but not very complicated either. I believe there are already forum posts covering how to get bottom of pipe that you could look at.

---

<div class="post-metadata">

**Author:** ![Abdulrahman\_Qasem](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Abdulrahman\_Qasem](https://forum.dynamobim.com/u/Abdulrahman_Qasem)\
**Post date:** [December 13, 2017, 6:46pm UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/9 "2017-12-13T18:46:22Z")

</div>

can you show me how does can be achieved by dynamo

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [December 13, 2017, 8:22pm UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/10 "2017-12-13T20:22:37Z")

</div>

You just had a few extra nodes.

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

---

<div class="post-metadata">

**Author:** ![Dimitar\_Venkov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dimitar_venkov/32/2068_2.png) [@Dimitar\_Venkov](https://forum.dynamobim.com/u/Dimitar_Venkov)\
**Post date:** [December 14, 2017, 2:16am UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/11 "2017-12-14T02:16:37Z")

</div>

It might be faster to get the mid point of the location curve of each pipe:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/0/80a51629e92857efa7479dc19f1e691280342e1b.png)

getting a point on the bottom of a pipe shouldn’t be very difficult either. Do you need the absolute lowest point from the geometric representation of the pipe? Then consider getting the MinPoint from the output of element.BoundingBox.

Or do you just need a pipe at the base of the pipe’s profile? Then you could pull the pipe’s radius and translate the mid point along the location line’s normal by the length of the radius.

---

<div class="post-metadata">

**Author:** ![Abdulrahman\_Qasem](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Abdulrahman\_Qasem](https://forum.dynamobim.com/u/Abdulrahman_Qasem)\
**Post date:** [December 14, 2017, 8:01am UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/12 "2017-12-14T08:01:50Z")

</div>

i do not want the center of pipe lenght, i mean the centroid of the pipe cross section,

another question , does that applicable to pipe accessories ?

---

<div class="post-metadata">

**Author:** ![Abdulrahman\_Qasem](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Abdulrahman\_Qasem](https://forum.dynamobim.com/u/Abdulrahman_Qasem)\
**Post date:** [December 14, 2017, 8:02am UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/13 "2017-12-14T08:02:45Z")

</div>

what if the category was pipe accessories ?

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [December 14, 2017, 2:25pm UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/14 "2017-12-14T14:25:47Z")

</div>

It will work for any element with solid geometry. Just try it and see.

But wouldn’t the centroid of the pipe cross section always be the center of pipe? What is your end goal here? What are you trying to accomplish?

---

<div class="post-metadata">

**Author:** ![Abdulrahman\_Qasem](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Abdulrahman\_Qasem](https://forum.dynamobim.com/u/Abdulrahman_Qasem)\
**Post date:** [December 14, 2017, 2:31pm UTC](https://forum.dynamobim.com/t/getting-the-centroid-of-the-pipe/17349/15 "2017-12-14T14:31:44Z")

</div>

i have tried it with pipe accessories but it does not work , you can try that

i need to get the centroid of pipe or pipe accessories in order to be able to take a dimension from this point to another point
