IDimSelection.CopyTo

Syntax

CopyTo(Dest: IDimSelection; Replace: Boolean);

Parameters

Dest. Consumer dimension, to which it is necessary to copy selection, selection schemas, and groups of elements from source dimension.

Replace. The parameter that determines whether selection, selection schemas, and groups of elements contained in the Dest data consumer are reset when data is copied. The selection should be reset if parameter value is True.

Description

The CopyTo method copies selection, selection schemas, and groups of elements of source dimension to consumer dimension.

Example

Sub Main;
Var
    MB: IMetabase;
    Dimen: IDimInstance;
    Selection, Selection1: IDimSelection;
Begin
    MB:=MetabaseClass.Active;
    Dimen:=MB.ItemById("D_TO").Open(NullAs IDimInstance;
    Selection:=Dimen.CreateSelection;
    Selection1:=Dimen.CreateSelection;
    Selection.SelectElement(11,True);
    Selection.SelectElement(30,True);
    Selection1.SelectElement(42,True);
    Selection1.SelectElement(56,True);
    Selection.CopyTo(Selection1,False);
End Sub Main;

After executing the example Selection is added to Selection1.

See also:

IDimSelection