Item [Overlays, Selection]
Item returns an individual overlay or shape. Returns a Shape object. This is the default method for Overlays and Selection collections.
Syntax
object.Item( Index )
Parameter |
Type |
Required/ Optional |
Default |
Description |
Index |
Variant |
Required |
This is the index number or object name. |
Remarks
Items can be referenced by their index number or by the object name. When the index number is used, objects are counted up from the bottom in the Contents window, so that item 1 is the bottom object, item 2 is the next object, and so on. When the object name is used, the full name of the object in the Contents window is specified. For example, a default contour map created from the Demogrid.grd file would be named "Contours-Demogrid.grd". The object name must match the name exactly as it appears in the Contents window and must be in quotes.
Example 1
This example demonstrates how to return the overlay name.
Debug.Print Overlays.Item(1)
Example 2
This example demonstrates how to return a reference to the second object, an ellipse, and change its line color to red. (See the Selection collection topic for the first part of this script.)
Set Map = Plot.Selection.Item(2)
Map.Line.ForeColorRGBA.Color= srfColorRed
Example 3
This example demonstrates how to return a reference to an object named "Contours-Demogrid.grd".
Set Contours = MapFrame.Overlays("Contours-Demogrid.grd")
Used by: Overlays collection, Selection collection