Add: ICalendarDimAttribute;
The Add method creates a new custom attribute.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
CalDim: ICalendarDimension;
UserAttrs: ICalendarDimAttributes;
UserAttr: ICalendarDimAttribute;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("CALENDAR_DIM").Edit;
CalDim := MObj As ICalendarDimension;
UserAttrs := CalDim.Attributes;
UserAttr := UserAttrs.Add;
UserAttr.Expression(-1).AsString := #34 + "Level element " + #34 + "+LEVEL";
UserAttrs.Name := UserAttr;
MObj.Save;
End Sub UserProc;
After executing the example a new custom attribute is added to calendar dictionary, and the same expression is set for elements of all levels. On creating the dictionary element names will be based on this attribute.
See also: