Description

Find an ancestor operator of a given type for some operator.

Return Type

An Object object.  

The ancestor operator of the given class, or Nothing if no such ancestor exists.

Syntax

object.AncestorOfOperator (Operator, ProgIDorCLSIDofAncestor)

The AncestorOfOperator Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McEngine.
OperatorRequired. An Object object.

The operator instance for which the ancestor operator is desired. This must be an interface implementing IMcHasObject or it must be the McObject of such an interface.

ProgIDorCLSIDofAncestorRequired. A String value.

Registered Prog ID of the “coclass” of the ancestor operator. Or the CLSID in a form like “{DC2F6FCB-08A7-40c0-BBDB-D3894B1C5F68}”; the braces are required. If the class has already been registered with the McObjects object manager (as it generally will have been), then just the registered type name is required. The registered type name is the portion of the ProgID after the first period up to any second period. All coclasses in the IQL type library are registered at start up, so as illustrated in the examples, you can just use the type name for virtually all operators. You may also use the name of a “base-type”, such as “McFeatures” (which will match any McPoints, McLines or McRegions ancestor).

Remarks

This function provides a convenient way to determine if an “operator” (an interface implementing IMcHasObject) has an ancestor operator of a given type and returns the ancestor if so. Use ParentOfOperator to get the immediate parent of an operator.