Skip to content

Commit

Permalink
Update boundingbox.py
Browse files Browse the repository at this point in the history
  • Loading branch information
marcantondahmen committed Nov 13, 2020
1 parent 81daa36 commit 4d2aee2
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions revitron/boundingbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,9 @@ class BoundingBox:
bbox = _(element).getBbox()
.. data:: Min
The Min Revit point object of the bounding box.
.. data:: Max
The Max Revit point object of the bounding box.
"""

Min = None

Max = None


def __init__(self, element):
"""
Inits a new BoundingBox instance for an element.
Expand All @@ -46,13 +36,36 @@ def __init__(self, element):
self.bbox = element.CropBox
else:
self.bbox = element.get_BoundingBox(None)


@property
def Min(self):
"""
The ``Min`` point of the bounding box.
Returns:
object: A Revit XYZ object
"""
try:
self.Min = self.bbox.Min
self.Max = self.bbox.Max
return self.bbox.Min
except:
pass




@property
def Max(self):
"""
The ``Max`` point of the bounding box.
Returns:
object: A Revit XYZ object
"""
try:
return self.bbox.Max
except:
pass


def containsXY(self, bbox2):
"""
Checks whether the bounding box contains another bounding box. Only in X and Y dimensions.
Expand Down

0 comments on commit 4d2aee2

Please sign in to comment.