CopyTo(
Dest: IDimSelectionSet;
Replace: Boolean;
AddDimensions: Boolean);
Dest. Consumer used to make copy of dictionary selection.
Replace. Parameter that determines whether selection should be replaced. If this parameter is set to True, the consumer is cleared before copying, otherwise only not selected elements are added.
AddDimensions. Parameter that determines whether dictionary selections, missing in the consumer, should be added.
The CopyTo method copies dictionary selection to the consumer passed by the Dest parameter.
Sub Main;
Var
MB: IMetabase;
CubeInstance, CubeInstance1: ICubeInstance;
Destination, Destination1: ICubeInstanceDestination;
DimSelectionSet, DimSelectionSet1: IDimSelectionSet;
i: Integer;
Begin
MB:=MetabaseClass.Active;
CubeInstance:=MB.ItemById("CUBE_1").Open(Null) As ICubeInstance;
Destination:=CubeInstance.Destinations.DefaultDestination;
DimSelectionSet:=Destination.CreateDimSelectionSet;
CubeInstance1:=MB.ItemById("CUBE_2").Open(Null) As 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 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: