Up to 4 dimensions of optional index selectors may be supplied for vector data. If selectors are supplied, then a temporary McObject that exposes selected sub-array is returned as the value. This SelectedMcObject is not a copy of the selected values, but is instead a reference to those selected values. Thus it's Value property may be assigned to to replace only the selected data values (this is equivalent to assigning to the SelectedValues property).
The major use for the SelectedMcObject property is to pass a selected subset of data on to other McOMGlobal routines without having to extract the SelectedValues as a Variant. The returned McObject instance should be released as soon as you are done with it.
The rules for the selector arguments are the same as for the SelectedValues property. The dimension selector may be a single, scalar index value or it may be an array of such values; negative indices in a selector are legal, but they are ignored. If the selector for a dimension is missing (VT_EMPTY, VT_ERROR or VT_NULL) then all elements of that dimension will be selected.
For N-dimensional shaped McObject's, it is possible to supply selector values as indexes into the shape unwrapped into 1-dimensional array. This is done by supplying only the varSelector0 argument (leaving the other arguments missing) and supplying it as a N-dimensional array (if varSelector0 is supplied as a scalar or 1-D array, then it selects only from Dimension 0). The result of selecting in this way is a 1-dimensional array of the selected elements. This situation is actually a very common one, since the logical vector operators (e.g., McOMGlobal.McOpEq) preserve the shape of the left argument. The samples illustrate this and other selection rules: they are well worth examining if you are selecting from anything but 1-dimensional arrays.
The selector arguments are supplied in C/C++ order for multidimensional shaped objects. That is, the left-most argument selects into Dim0, the slowest moving dimension. This is the same ordering as in C/C++, but it is the reverse of dimension ordering in VB.
On assignment, if all selector values are missing, then variable dimensions are allowed to change size on the assignment to accomodate the source data, but the number of dimensions is not allowed to change nor is the fixed or variable attribute of each dimension. Assigning to the Value property sets the full shape of the stored data, as does assigning a shape directly to the Shape property.
See the Notes with the SelectedValues property for more discussion of selected shape.
The SelectedMcObject will be a newly created McObject that will be unnamed and have no ParentMcObject. And it will not be part of the McObjects collection, so it cannot be looked up via the Item property nor will it appear in any enumeration.