# AttributeError: module 'openmc' has no attribute 'BoundingBox'

**URL:** <https://openmc.discourse.group/t/attributeerror-module-openmc-has-no-attribute-boundingbox/3530>\
**Category:** User Support\
**Created:** [October 21, 2023, 7:16pm UTC](https://openmc.discourse.group/t/attributeerror-module-openmc-has-no-attribute-boundingbox/3530 "2023-10-21T19:16:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![arifv](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@arifv](https://openmc.discourse.group/u/arifv)\
**Post date:** [October 21, 2023, 7:16pm UTC](https://openmc.discourse.group/t/attributeerror-module-openmc-has-no-attribute-boundingbox/3530/1 "2023-10-21T19:16:49Z")

</div>

Hello! I am trying to use a bounding box to create slabs, but I’m having some issues as it doesn’t seem to be recognized. After going through some documentation, I’m also finding bounding boxes with different names (BoundingBox versus bounding\_box). I’ve tried both and they output the same error. I’ve tried accessing the bounding\_box attribute, and that seems to work, so I don’t know what the issue is. I’m currently on version 0.13.3, is there any way to get around this problem?

```auto
import openmc
sphere = openmc.Sphere(r=5.0)
cell = openmc.Cell(fill=None, region=-sphere)

lower_left, upper_right = cell.region.bounding_box
print(lower_left)
print(upper_right)
box = openmc.bounding_box(lower_left, upper_right)

```

Output:

```auto
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[2], line 8
      6 print(lower_left)
      7 print(upper_right)
----> 8 box = openmc.bounding_box(lower_left, upper_right)

AttributeError: module 'openmc' has no attribute 'bounding_box'

```

---

<div class="post-metadata">

**Author:** ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)\
**Post date:** [October 21, 2023, 7:59pm UTC](https://openmc.discourse.group/t/attributeerror-module-openmc-has-no-attribute-boundingbox/3530/2 "2023-10-21T19:59:12Z")

</div>

The .bounding\_box is a method you can call on openmc.Cell, openmc.Region or openmc.Geometry objects. It returns a openmc.BoundingBox class object.

The openmc.BoundingBox class object behaves like a python tuple with extra methods. The first tuple entry is the lower left and the second is the upper right. The class has a few extra methods like extend.

I don’t normally use the bounding box to contruct geoemtry, rather to know how big the already constructed geometry is

---

<div class="post-metadata">

**Author:** ![arifv](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@arifv](https://openmc.discourse.group/u/arifv)\
**Post date:** [October 21, 2023, 8:13pm UTC](https://openmc.discourse.group/t/attributeerror-module-openmc-has-no-attribute-boundingbox/3530/3 "2023-10-21T20:13:45Z")

</div>

What I’m essentially trying to do with a bounding box is create a finite rectangular prism. Is that not the correct use for it? Are there any other ways to create finite boxes in OpenMC?

---

<div class="post-metadata">

**Author:** ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)\
**Post date:** [October 21, 2023, 8:46pm UTC](https://openmc.discourse.group/t/attributeerror-module-openmc-has-no-attribute-boundingbox/3530/4 "2023-10-21T20:46:09Z")

</div>

Perhaps this is what you are looking for

[https://docs.openmc.org/en/stable/pythonapi/generated/openmc.model.RectangularParallelepiped.html](https://docs.openmc.org/en/stable/pythonapi/generated/openmc.model.RectangularParallelepiped.html)

---

<div class="post-metadata">

**Author:** ![arifv](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@arifv](https://openmc.discourse.group/u/arifv)\
**Post date:** [October 25, 2023, 1:33pm UTC](https://openmc.discourse.group/t/attributeerror-module-openmc-has-no-attribute-boundingbox/3530/5 "2023-10-25T13:33:53Z")

</div>

Not sure how I missed this. Thank you so much.
