LinkedParam: IMsModelParamAttributes;
The LinkedParam property determines a modeling parameter, with which object parameter is linked.
Executing the example requires that the repository contains:
A cube with the CUBE identifier. The cube should contain one integer parameter.
A modeling container with the CONTAINER identifier.
A metamodel with the METAMODEL identifier. The metamodel should have a parameter of the Selection type with the GROUP identifier based on a dictionary containing an attribute with the KEY identifier.
Add links to the Dimensions, Metabase, Ms system assemblies.
Sub SubProc;
Var
mb: IMetabase;
cubeDesc: IMetabaseObjectDescriptor;
msKey: Integer;
mm: IMsMetaModel;
param: IMsModelParam;
paramValues: IMsObjectParamValues;
paramValue: IMsObjectParamValue;
linkedParam: IMsModelParamAttributes;
dim: IDimInstance;
attrs: IMsDimAttributesList;
attr: IDimAttribute;
Begin
// Get repository
mb := MetabaseClass.Active;
// Get cube
cubeDesc := mb.ItemById("CUBE");
// Get modeling container
msKey := mb.ItemById("CONTAINER").Key;
// Get metamodel
mm := mb.ItemByIdNamespace("METAMODEL", msKey).Edit As IMsMetaModel;
// Get metamodel parameter
param := mm.Params.FindById("GROUP");
// Add a cube to metamodel object parameters
mm.ObjectParamValues.Clear;
paramValues := mm.ObjectParamValues.Add(cubeDesc);
// Get cube parameter
paramValue := paramValues.Item(0);
// Bind metamodel parameter with cube parameter
linkedParam := paramValue.LinkedParam;
linkedParam.Parameter := param;
// Get parameter dimension attribute
dim := param.LinkedObject.Open(Null) As IDimInstance;
attr := dim.Attributes.FindById("KEY").Attribute;
// Set attribute parameter
linkedParam.ClearAttributes;
attrs := linkedParam.Attributes;
attrs.Add(attr);
// Save metamodel
(mm As IMetabaseObject).Save;
End Sub SubProc;
After executing the example cube and metamodel parameters are bound, after which metamodel parameter value will be sent to the cube parameter.
See also: