Tekla Open API

Detailed and full API reference helps you master Tekla Open API

This is the most recent version of Tekla Open API.
For older versions, please visit Tekla Warehouse.

RectangleBoundingBox Class

The RectangleBoundingBox class represents a bounding box for an object, i.e. the surrounding box of the object. The bounding box contains the calculated corner points of the box. The rectangle bounding box is inherited from the axis-aligned bounding box. The AABB also contains methods for getting the center point of the box.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.Geometry3dAABB
    Tekla.Structures.DrawingRectangleBoundingBox

Namespace:  Tekla.Structures.Drawing
Assembly:  Tekla.Structures.Drawing (in Tekla.Structures.Drawing.dll) Version: 2018.1.0.0 (2018.1.0.0)
Syntax
[SerializableAttribute]
public sealed class RectangleBoundingBox : AABB, 
	IIsEqual

The RectangleBoundingBox type exposes the following members.

Properties
  Name Description
Public property AngleToAxis
The angle of the bounding box in relation to the axis (the coordinate system's X-plane).
Public property Height
The height of the bounding box.
Public property LowerLeft
The lower left corner point of the bounding box.
Public property LowerRight
The lower right corner point of the bounding box.
Public property MaxPoint
The maximum point of the axis-aligned 3d bounding box.
(Inherited from AABB.)
Public property MinPoint
The minimum point of the axis-aligned 3d bounding box.
(Inherited from AABB.)
Public property UpperLeft
The upper left corner point of the bounding box.
Public property UpperRight
The upper right corner point of the bounding box.
Public property Width
The width of the bounding box.
Top
Methods
  Name Description
Public method Collide
Checks if the current axis-aligned 3d bounding box collides with another given axis-aligned 3d bounding box. Both axis-aligned 3d bounding boxes need to be in the same coordinate system or in the same workplane, so that they are defined using the same axes.
(Inherited from AABB.)
Public methodStatic member CreateRectangleBoundingBox
Creates a new RectangleBoundingBox with the given values.
Public method GetCenterPoint
Returns the geometric center point of the current axis-aligned 3d bounding box.
(Inherited from AABB.)
Public method IsEqual
Compares the current object with an object of the same type.
Public method IsInside(LineSegment)
Checks if the given line segment is inside the current axis-aligned 3d bounding box.
(Inherited from AABB.)
Public method IsInside(Point)
Checks if the given point is inside the current axis-aligned 3d bounding box.
(Inherited from AABB.)
Public method ToString
Returns the rectangle bounding box values as a string.
(Overrides ObjectToString.)
Top
Examples
The following example is about how to draw a polygon around an object's bounding box:
using Tekla.Structures.Drawing;

public class Example
{
       static bool DrawBB(ViewBase DrawView, RectangleBoundingBox boundingBox, DrawingColors Color)
       {
           PointList points = new PointList();
           points.Add(boundingBox.LowerLeft);
           points.Add(boundingBox.UpperLeft);
           points.Add(boundingBox.UpperRight);
           points.Add(boundingBox.LowerRight);
           Polygon MyPolygon = new Polygon(DrawView, points);
           MyPolygon.Attributes.Line.Color = Color;
           MyPolygon.Insert();

           return true;
       }
}
See Also