IDimSelection.CopyTo

Syntax

CopyTo(Dest: IDimSelection; Replace: Boolean);

Parameters

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

Replace. Parameter that determines whether selection, selection schemas, and element groups contained in the Dest 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 element groups of source dimension to target 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