# Routing of Cables/flex pipes using centroid of boundingbox(selecting elements and getting their bounding box)

**URL:** <https://forum.dynamobim.com/t/routing-of-cables-flex-pipes-using-centroid-of-boundingbox-selecting-elements-and-getting-their-bounding-box/91799>\
**Category:** Revit\
**Tags:** revit, geometry, dynamo\
**Created:** [July 14, 2023, 8:02am UTC](https://forum.dynamobim.com/t/routing-of-cables-flex-pipes-using-centroid-of-boundingbox-selecting-elements-and-getting-their-bounding-box/91799 "2023-07-14T08:02:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravi007kapuria](https://avatars.discourse-cdn.com/v4/letter/r/ed655f/32.png) [@ravi007kapuria](https://forum.dynamobim.com/u/ravi007kapuria)\
**Post date:** [July 14, 2023, 8:02am UTC](https://forum.dynamobim.com/t/routing-of-cables-flex-pipes-using-centroid-of-boundingbox-selecting-elements-and-getting-their-bounding-box/91799/1 "2023-07-14T08:02:24Z")

</div>

I’m using Mpover package for the script , i have selected two Equipments, got their connector details(points) using Mpover package , and then a list of elements in between those devices throught their centroid points (using select model elements and get their cetroid using bounding box and some of them are not just solid nut mix of solid and lines therefore boundingbox seemed working). later i collected all these points and sorted them by X,Y & Z points (i saw this way on dynamo forum). and connected these to flexpipe by curve(mpover package).

the trouble is sometimes i get the desired output but in other cases the pipes goes to random point then comes back to other random point and the output looks tangled wires.

Please help. Thanking you all in advance

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [July 14, 2023, 8:05am UTC](https://forum.dynamobim.com/t/routing-of-cables-flex-pipes-using-centroid-of-boundingbox-selecting-elements-and-getting-their-bounding-box/91799/2 "2023-07-14T08:05:11Z")

</div>

Hello @ravi007kapuria and welcome here 😉 could you show/share some material, then its much easier to get help and help…thanks

---

<div class="post-metadata">

**Author:** ![ravi007kapuria](https://avatars.discourse-cdn.com/v4/letter/r/ed655f/32.png) [@ravi007kapuria](https://forum.dynamobim.com/u/ravi007kapuria)\
**Post date:** [July 14, 2023, 8:27am UTC](https://forum.dynamobim.com/t/routing-of-cables-flex-pipes-using-centroid-of-boundingbox-selecting-elements-and-getting-their-bounding-box/91799/3 "2023-07-14T08:27:22Z")

</div>

Hi Sovitek , thanks for reaching !!  
As a new user i’m not able to upload anything ,  
[https://drive.google.com/drive/folders/1EqyZ7LRPlz8JeXbyVm2ow0Ys2msGRprf?usp=sharing](https://drive.google.com/drive/folders/1EqyZ7LRPlz8JeXbyVm2ow0Ys2msGRprf?usp=sharing)

I have attached drive link , two pictures in it describing how my selection of points makes the routing as desired and in other a tangled wire if i need the wires to go down through pole to cabinet and dynamo script as well.

Thanks again for the lightning fast response

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [July 14, 2023, 9:12am UTC](https://forum.dynamobim.com/t/routing-of-cables-flex-pipes-using-centroid-of-boundingbox-selecting-elements-and-getting-their-bounding-box/91799/4 "2023-07-14T09:12:43Z")

</div>

thanks, could you share your rvt or just a rvt example with that situation

---

<div class="post-metadata">

**Author:** ![ravi007kapuria](https://avatars.discourse-cdn.com/v4/letter/r/ed655f/32.png) [@ravi007kapuria](https://forum.dynamobim.com/u/ravi007kapuria)\
**Post date:** [July 14, 2023, 9:53am UTC](https://forum.dynamobim.com/t/routing-of-cables-flex-pipes-using-centroid-of-boundingbox-selecting-elements-and-getting-their-bounding-box/91799/5 "2023-07-14T09:53:19Z")

</div>

Uploaded

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [July 14, 2023, 3:21pm UTC](https://forum.dynamobim.com/t/routing-of-cables-flex-pipes-using-centroid-of-boundingbox-selecting-elements-and-getting-their-bounding-box/91799/6 "2023-07-14T15:21:19Z")

</div>

thx thanks dont have time you know tour de france 😉 i take a look later, and see if i can fix it…no guarantee 😉
