Add: Integer;
The Add method adds a new element to the dictionary and returns number of row where it can be placed.
Element is added to the end of the list. Values of all attributes are not set, use the AttributeValue property to set values.
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;
i:=DimElems.Add;
DimElems.AttributeValue(i,0) := i;
DimElems.AttributeValue(i,1) := "Element " + i.ToString;
DimElems.AttributeValue(i,2) := i;
MObj.Save;
End Sub Main;
After executing the example a new element is created in fact dimension. Cube identifier: CUBE_1.
See also: