Description

Add an McGraphOverlay instance to the collection.

Return Type

A McGraphOverlay object.  

The McGraphOverlay added (or existing) collection instance.

Syntax

object.Add (varIMcGraphOverlayToAdd)

The Add Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McDisplayOverlays.
varIMcGraphOverlayToAddRequired. A Variant value.

Remarks

An existing McGraphOverlay instance can be added to the collection, or a new one with a given name may be created and then added.

The newly added McGraphOverlay instance will have an index value in the collection equal to the Count property at the time of the call. This index value will remain valid so long as no call is made to the Remove method, but it is best keep a reference to the McGraphOverlay instance itself and to not rely on the index. The McGraphOverlay.Name property is a more reliable way to look up instances, where you don't have the actual instance.

Overlays Add'ed to the DisplayOverlays collection by name and the default overlay named “DefaultOverlay” have a Template with TemplateID mcgtStandardAutoDisplay automatically created. This template is given a standard color with no fill. These overlays have the McGraphOverlay.Views.ViewerGroupsToTrack property set to vgMDIImageWindow and vgImageMcDisplay, so by default, they will display on MDI child Image windows and on McImage.Display displays when made visible (see below). Note that this automatic display will only occur if the Parent McFeatures is itself a child of some McImage and if the AutoDisplayTemplateID has been assigned (normally the value of mcgtStandardAutoDisplay).

The “DefaultOverlay” is the initial MasterGraphOverlay and it is initially Visible. However other overlays created by name (e.g., DisplayOverlays.Add “MyOverlayName”) will be initially not visible. Normally, overlays are made visible by making them the MasterGraphOverlay (which makes all other overlays in the collection non-Visible). But you can assign TRUE directly to the McGraphOverlay.Visible property if you are prepared to deal with the possiblility the multple overlays might be showing the same features.

Exceptions

If a name is passed in, the passed-in name must not collide with any existing name of any McObject that is a child of the McFeatures (these names will include the names of all measurements based on the McFeatures).

It is not an error to add an instance that is already part of the collection; thus the Add method can be used as a “fail-safe” get_Item method.