Show contents 

Dimensions > Dimensions Assembly Interfaces > IDimSelectionSet > IDimSelectionSet.CopyToEx

IDimSelectionSet.CopyToEx

Syntax

CopyToEx: (Dest: IDimSelectionSet; Options: SelectionCopyToExOptions; ReplaceSelection: Boolean; AddDimensions: Boolean);

Parameters

Dest. Consumer used to make copy of dictionary selection.

Options. It determines copied option (selection only, selection and groups of elements; selection and selection schemas).

ReplaceSelection. The 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. The parameter that determines whether dictionary selections that are absent in the consumer will be added.

Description

The CopyToEx method copies groups of elements and dictionary selections to the specified data consumer.

Comments

To copy a dictionary selection to the specified data consumer, use the IDimSelectionSet.CopyTo method.

Example

Executing the example requires two cubes with the CUBE_1 and CUBE_2 identifiers.

Add links to the Metabase, Cubes, Dimensions system assemblies.

Sub main;
Var
    MB: IMetabase;
    CubeInstance, CubeInstance1: ICubeInstance;
    Destination, Destination1: ICubeInstanceDestination;
    DimSelectionSet, DimSelectionSet1: IDimSelectionSet;
    Options: SelectionCopyToExOptions;
    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;
    Options := SelectionCopyToExOptions.None;
    DimSelectionSet.CopyToEx(DimSelectionSet1, Options, TrueTrue);
    DimSelectionSet.Clear;
End Sub main;

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