Dimensions > Dimensions Assembly Interfaces > IDimElementArray > IDimElementArray.CopyTo
CopyTo(Dest: IDimElementArray; Replace: Boolean);
Dest. Data consumer, to which elements must be copied.
Replace. Parameter that determines whether data consumer elements will be replaced. If the parameter is set to True, data consumer is cleared before copying. If the parameter is set to False, elements are added to the end of the array.
The CopyTo method copies an array of elements to the Dest consumer.
Sub UserProc;
Var
MB: IMetabase;
Dimen: IDimInstance;
Elem: IDimElements;
ElemArr, ElemArr1: IDimElementArray;
Begin
MB:=MetabaseClass.Active;
Dimen:=MB.ItemById("D_TO").Open(Null) As IDimInstance;
Elem:=Dimen.Elements;
ElemArr:=Elem.Children(10);
ElemArr1:=Elem.Children(11);
ElemArr.CopyTo(ElemArr1, True);
End Sub UserProc;
After executing the example elements of the ElemArr array are copied to the ElemArr1 array. ElemArr1 contents is deleted before copying.
See also: