Show contents 

Dimensions > Dimensions Assembly Interfaces > IDimElementGroup > IDimElementGroup.AddPrimitive

IDimElementGroup.AddPrimitive

Syntax

AddPrimitive(primitiveType: SelectionGroupType): IDimElementGroupPrimitive;

Parameters

primitiveType. Type of the primitive to be added.

Description

The AddPrimitive method adds primitives to dictionary element group.

Example

Sub UserProc;
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(0False);
        Sel.SelectElement(3False);
        Sel.SelectElement(5False);
        Sel.SelectElement(10False);
        MObj.Save;
    End If;
End Sub UserProc;

After executing the example a primitive is added to the first group of dictionary elements.

See also:

IDimElementGroup