IsObjectInBox

Verifies an object's bounding box is inside of another bounding box.

Syntax

Rhino.IsObjectInBox (strObject, arrBox, [blnMode])

Parameters

strObject

Required.  String.  The identifier of an object.

arrBox

Required.  Array.  The bounding box to test against. A bounding box is an array of eight 3-D points that define the corners of the box.  Points need to be  in counter-clockwise order starting with the bottom rectangle of the box.

blnMode

Optional.  Boolean.  The test mode.

Value

Description

True (Default)

The object's bounding box must be contained by the test bounding box. In other words, test.min <= object.min and object.max <= test.max.

False

The object's bounding box must be contained by or intersect with the test bounding box.

Returns

True

The object is inside the bounding box.

False

The object is not inside the bounding box.

Null

On error.

Example

Dim arrBox, arrObjects strObject

arrBox = Rhino.GetBox

If IsArray(arrBox) Then

  Rhino.EnableRedraw False

  arrObjects = Rhino.AllObjects

  For Each strObject In arrObjects

    If Rhino.IsObjectInBox(strObject, arrBox, False) Then

      Rhino.SelectObject strObject

    End If

  Next

  Rhino.EnableRedraw True

End If

Also See

BoundingBox

GetBox