# Create a Cuboid from 8 points

**URL:** <https://forum.dynamobim.com/t/create-a-cuboid-from-8-points/83969>\
**Category:** Revit\
**Tags:** revit, geometry, dynamo\
**Created:** [December 9, 2022, 5:52am UTC](https://forum.dynamobim.com/t/create-a-cuboid-from-8-points/83969 "2022-12-09T05:52:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![NIRMAL](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nirmal/32/150135_2.png) [@NIRMAL](https://forum.dynamobim.com/u/NIRMAL)\
**Post date:** [December 9, 2022, 5:52am UTC](https://forum.dynamobim.com/t/create-a-cuboid-from-8-points/83969/1 "2022-12-09T05:52:20Z")

</div>

Helllo Everyone,  
I want to create a cuboid by 8 points and there is already a post related to it which isn’t helping.  
If I use Element.BoundingBox then the output I need is not correct as it doesn’t take the rotation of the element. However I am able to get 8 corner points from a scope box and I just want a cuboid from these 8 points. so that I can do a Clash check in between the obtained geometry and centroid of all model elements to stamp the Scope Box name in Elements.  
please check the snap for better understanding.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/8/38ee8e0291ec0554f0df21d37f6a634710ea5709.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/7/a7f25d1b0f43fa3b0613a9189b3bbc09a24175a3.png)  
 ![ScopeBox](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/b/4b974fbb109638925d94413b3956445e66f5523a.png)

All suggestions are welcome.  
Thanks in Advance.

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [December 9, 2022, 6:06am UTC](https://forum.dynamobim.com/t/create-a-cuboid-from-8-points/83969/2 "2022-12-09T06:06:12Z")

</div>

There’s probably an easier way to do it, but this should work.

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

[Get cuboids.dyn](https://forum.dynamobim.com/uploads/short-url/EsKCIKZNixZ2owzjLUU9rYQGZG.dyn) (24.5 KB)

 ![Get cuboids](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/b/6b4bf369ab99dfeba77d4c8f1433c95ca116e030.png)

---

<div class="post-metadata">

**Author:** ![bvs1982](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@bvs1982](https://forum.dynamobim.com/u/bvs1982)\
**Post date:** [February 20, 2023, 12:24pm UTC](https://forum.dynamobim.com/t/create-a-cuboid-from-8-points/83969/3 "2023-02-20T12:24:57Z")

</div>

I kinda like this approach but i have two questions @GavinCrump ;

How can i get the Intersecting Elements per Solid. Now it takes the two Solids together.

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/4/1491078af3c40aa273ddf3751ae3801eb3814e6e.png)

How can get rid of the points i don’t ‘need’. Because bcause of those points  
I get that extra Wall in my list(?)

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

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [February 20, 2023, 12:43pm UTC](https://forum.dynamobim.com/t/create-a-cuboid-from-8-points/83969/4 "2023-02-20T12:43:40Z")

</div>

The bounding box of that solid will be axis aligned to the Y axis, so may pick up objects outside it. Try getting the geometry of the objects to test for solid intersections with the original extrusions instead.

---

<div class="post-metadata">

**Author:** ![NIRMAL](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nirmal/32/150135_2.png) [@NIRMAL](https://forum.dynamobim.com/u/NIRMAL)\
**Post date:** [February 20, 2023, 1:06pm UTC](https://forum.dynamobim.com/t/create-a-cuboid-from-8-points/83969/5 "2023-02-20T13:06:01Z")

</div>

Try using the geometry.doesIntersect node.  
For the first input, use the solids obtained from your scope boxes. For the second input, use the centroid of the elements. This is a better way to determine which scope box an element belongs to since an element can be present in multiple scope boxes, and this method determines which box it is in based on the majority of the element’s volume. To obtain the centroid of an element, use the element.getCentroid method. If that doesn’t work, try obtaining the bounding boxes for the elements and then calculate the centroid of the bounding box.

---

<div class="post-metadata">

**Author:** ![bvs1982](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@bvs1982](https://forum.dynamobim.com/u/bvs1982)\
**Post date:** [February 20, 2023, 1:55pm UTC](https://forum.dynamobim.com/t/create-a-cuboid-from-8-points/83969/6 "2023-02-20T13:55:31Z")

</div>

Thanks for putting me in the right direction.

Using `Geometry.DoesIntersect` _Cross Product_ did it for me.

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