RegionNear Method

See Also Applies To Example Model

Returns a Region object consisting of Cell objects within a specified radius.

object expression.RegionNear ([Radius],[Angle])

object expression    Required. An object expression that evaluates to an object in the Applies To list.

Radius    Optional Double. The distance defining the search radius for collecting nearby Cell objects. Defaults to the value of the Radius property of the ViewField object.

Angle    Optional Double. The span angle that defines the area to perform the search. Defaults to the value of the Span property of the ViewField object.

Remarks

The default parameters can be changed by modifying a Bot object's ViewField As in the following example:

Bots.ViewField.Radius = 100

If the object this method applies to is a Cell object, then Angle is omitted.

Example

In the following example, the appearance of the Cell objects within a radius of 50 of a Bot object is modified.

Bot.RegionNear(50).Shape.Style3D = vbtSunken

The next example is equivalent to the previous example, but uses the ViewField object to define the default interaction radius.

Bots.ViewField.Radius=50
Bot.RegionNear.Shape.Style3D = vbtSunken