Description

Makes a copy of a supplied McFeatures-derived object and adds it to the list or replaces an existing list item with the copy.

Return Type

A Long value.  

The list index (0 being the first) of the new or replaced list item. The Count property will have changed only if a new list item is added, in which case the returned index value will equal Count-1 (see Examples).

Syntax

object.Add (McFeaturesToAdd, Name)

The Add Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McFeaturesList.
McFeaturesToAddRequired. A McFeatures object.

The McFeatures-derived object instance to add. Depending on the TypeOfList property this may be an McRegions, McLines or McPoints object.

NameRequired. A String value.

The name to give the new list item or the name of an existing list item to be replaced. This name must be one that the ValidateName method will accept without change; you may use the ValidateName method to create a valid name from most source strings.

Remarks

The copy of the supplied McFeatures-derived operator will lose any existing parent McObject; the copy's parent McObject will be that backing the McFeaturesList operator instance.

Exceptions

The McFeaturesToAdd source object must match an McFeatures-derived type that is one allowed by the TypeOfList property. The supplied Name must be one that the ValidateName method will accept without change.