Show contents 

Ms > Ms Assembly Interfaces > IMsMetaModel > IMsMetaModel.Params

IMsMetaModel.Params

Syntax

Params: IMsModelParams;

Description

The Params property returns the collection of metamodel parameters.

Example

Executing the example requires that the repository contains a time series database with the FC_PARAM identifier. This database contains the COUNTRY attribute referring to the dictionary. The database modeling container contains a metamodel with the METAMODEL identifier and a model with the MODEL identifier.

Sub UserProc;
Var
    mb: IMetabase;
    Catalog: IRubricator;
    Transforms: IMetabaseObjectDescriptor;
    MetaModel: IMsMetaModel;
    MMParams: IMsModelParams;
    Param: IMsModelParam;
    Atts: IMetaAttributes;
    Dict: IMetabaseObjectDescriptor;
    ChainEntries: IMsCalculationChainEntries;
    Cycle: IMsCalculationChainIterator;
    dimInst: IDimInstance;
    Model: IMsModel;
Begin
    mb := MetabaseClass.Active;
    Catalog := mb.ItemById("FC_PARAM").Bind As IRubricator;
    Transforms := Catalog.ModelSpace;
    MetaModel := mb.ItemByIdNamespace("METAMODEL", Transforms.Key).Edit As IMsMetaModel;
    MMParams := MetaModel.Params;
    MMParams.Clear;
    Param := MMParams.Add;
    Param.Name := "Country param";
    Param.Id := "Country_Param";
    Param.Hidden := True;
    Param.DataType := DbDataType.Integer;
    Atts := Catalog.Facts.Attributes;
    Dict := Atts.FindById("COUNTRY").ValuesObject;
    Param.LinkedObject := Dict;
    ChainEntries := MetaModel.CalculationChain;
    ChainEntries.Clear;
    Cycle := ChainEntries.AddIterator("For");
    Cycle.Parameter := Param;
    dimInst := Dict.Open(NullAs IDimInstance;
    Cycle.Selection := dimInst.CreateSelection;
    Cycle.Selection.SelectAll;
    Model := mb.ItemByIdNamespace("MODEL", Transforms.Key).Bind As IMsModel;
    Cycle.Contents.AddModel(Model);
    (MetaModel As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the parameter that is a reference to the dictionary, is set for the metamodel. The metamodel calculation chain is made of the cycle that contains a model.

See also:

IMsMetaModel