AddPrimitive(primitiveType: SelectionGroupType): IDimElementGroupPrimitive;
primitiveType. Type of the primitive to be added.
The AddPrimitive method enables to add primitives to dictionary element group.
Sub Main;
Var
MB: IMetabase;
MObjDesc: IMetabaseObjectDescriptor;
MObj: IMetabaseObject;
ElemGroup: IDimElementGroup;
ElemGroupPrim: IDimElementGroupPrimitive;
Sel: IDimSelection;
Begin
MB := MetabaseClass.Active;
MObjDesc := MB.ItemById("D_TO");
If MObjDesc.Children.Count <> 0 Then
MObj := MObjDesc.Children.Item(0).Edit;
ElemGroup := MObj As IDimElementGroup;
ElemGroupPrim := ElemGroup.AddPrimitive(SelectionGroupType.List);
Sel := ElemGroupPrim.Selection;
Sel.SelectElement(0, False);
Sel.SelectElement(3, False);
Sel.SelectElement(5, False);
Sel.SelectElement(10, False);
MObj.Save;
End If;
End Sub Main;
After executing the example a primitive is added to the first group of dictionary elements.
See also: