Show contents 

Dimensions > Dimensions Assembly Interfaces > IDimSelectionSet > IDimSelectionSet.CopyTo

IDimSelectionSet.CopyTo

Syntax

CopyTo(

Dest: IDimSelectionSet;

Replace: Boolean;

AddDimensions: Boolean);

Parameters

Dest. Data consumer that is used to copy dictionary selection.

Replace. Parameter that determines whether data consumer selection will be replaced. If the parameter is set to True, the data consumer is cleared before copying. If the parameter is set to False, only not selected elements are added.

AddDimensions. Parameter that determines whether dictionary selections that are absent in the consumer will be added.

Description

The CopyTo method copies dictionary selection to the data consumer passed by the Dest parameter.

Example

Sub UserProc;
Var
    MB: IMetabase;
    CubeInstance, CubeInstance1: ICubeInstance;
    Destination, Destination1: ICubeInstanceDestination;
    DimSelectionSet, DimSelectionSet1: IDimSelectionSet;
    i: Integer;
Begin
    MB:=MetabaseClass.Active;
    CubeInstance:=MB.ItemById("CUBE_1").Open(NullAs ICubeInstance;
    Destination:=CubeInstance.Destinations.DefaultDestination;
    DimSelectionSet:=Destination.CreateDimSelectionSet;
    CubeInstance1:=MB.ItemById("CUBE_2").Open(NullAs ICubeInstance;
    Destination1:=CubeInstance.Destinations.DefaultDestination;
    DimSelectionSet1:=Destination.CreateDimSelectionSet;
    For i:=0 To DimSelectionSet.Count-1 Do
        DimSelectionSet.Item(i).SelectAll;
    End For;
    DimSelectionSet.CopyTo(DimSelectionSet1,True,True);
    DimSelectionSet.Clear;
End Sub UserProc;

After executing the example the selection in the cube with the CUBE_1 identifier is copied to the cube with the CUBE_2 identifier.

See also:

IDimSelectionSet