revitron.boundingbox¶
The boundingbox
submodule complements the Revit API bounding box methods
by a simple helper class for working with bounding box elements.
Classes:
|
A |
- class BoundingBox(element)[source]¶
Bases:
object
A
BoundingBox
class instance is a wrapper element for Revit bounding box object.Create a new instance as follows:
bbox = revitron.BoundingBox(element)
Or even:
bbox = _(element).getBbox()
Attributes:
The
Max
point of the bounding box.The
Min
point of the bounding box.Methods:
__init__
(element)Inits a new BoundingBox instance for an element.
containsXY
(bbox2)Checks whether the bounding box contains another bounding box.
Returns the center point of the bounding box.
hasPointXY
(point)Checks whether a point is inside a bounding box.
- property Max¶
The
Max
point of the bounding box.- Returns
A Revit XYZ object
- Return type
object
- property Min¶
The
Min
point of the bounding box.- Returns
A Revit XYZ object
- Return type
object
- __init__(element)[source]¶
Inits a new BoundingBox instance for an element. In case the element has a scope box applied, the scope box’s bounding box is taken. In case the element has no scope box, but is a view plan, the crop box is used. The default Revit bounding box is used for all other elements.
- Parameters
element (object) – A Revit Element
- containsXY(bbox2)[source]¶
Checks whether the bounding box contains another bounding box. Only in X and Y dimensions.
Example:
contains = _(element1).getBbox().containsXY(_(element2).getBbox())
- Parameters
bbox2 (object) – A bounding box object
- Returns
True if the bounding box entirely contains bbox2
- Return type
boolean