Clear;
The Clear method removes all dictionary elements.
Executing the example requires a standard cube with the CUBE_1 identifier.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Cube: IStandardCube;
CustDim: ICustomDimension;
DimElems: ICustomDimElements;
i: Integer;
Begin
MB:=MetabaseClass.Active;
MObj:=MB.ItemById("CUBE_1").Edit;
Cube:=MObj As IStandardCube;
CustDim:=Cube.FactDimension.Dimension As ICustomDimension;
DimElems:=CustDim.Elements;
DimElems.Clear;
i:=DimElems.Add;
DimElems.AttributeValue(i,0):=i+1;
DimElems.AttributeValue(i,1):="New_Element";
DimElems.AttributeValue(i,2):=i+1;
MObj.Save;
End Sub Main;
After executing the example all elements of fact dimension are deleted and one new element is created instead.
See also: