BoundingBox

Returns either a world axis-aligned or a construction plane axis-aligned bounding box of an object or of several objects.

Syntax

Rhino.BoundingBox (strObject [, strView [, blnWorldCoords]])

Rhino.BoundingBox (strObject [, arrPlane [, blnWorldCoords]])

Rhino.BoundingBox (arrObjects [, strView [, blnWorldCoords]])

Rhino.BoundingBox (arrObjects [, arrPlane [, blnWorldCoords]])

 

Parameters

strObject

Required.  String.  The identifier of the object.

arrObjects

Required.  Array.  An array of strings identifying the objects.

strView

Optional.  String.  The title of the view that contains the construction plane to which the bounding box should be aligned.  If omitted, a world axis-aligned bounding box will be calculated.

arrPlane

Optional.  Array.  The plane to which the bounding box should be aligned.  If omitted, a world axis-aligned bounding box will be calculated.

blnWorldCoords

Optional.  Boolean.  Whether or not to return the bounding box as world coordinates or construction plane coordinates.  The default is to return world coordinates (True).  Note, this option does not apply to world axis-aligned bounding boxes.

Returns

Array

An array of eight 3-D points that define the bounding box if successful.  Points are returned in counter-clockwise order starting with the bottom rectangle of the box.  See the image below for details.

Null

If not successful, or on error.

Example

Dim strObject, arrBox, arrPoint, intCount

strObject = Rhino.GetObject("Select object")

If Not IsNull(strObject) Then

arrBox = Rhino.BoundingBox(strObject)

If IsArray(arrBox) Then

intCount = 0

For Each arrPoint In arrBox

Rhino.AddTextDot CStr(intCount), arrPoint

intCount = intCount + 1

Next

End If

End If

boundingbox.jpg