LinkedObjectParams: IMetabaseObjectParamValues;
The LinkedObjectParams property returns the collection of parameter values that is used to open linked dictionary.
The LinkedObjectParams property is relevant if the LinkedObject property is determined for the parameter, and the dictionary specified in it is parametric.
Executing the example requires that the repository contains a calculation algorithm with the ALGORITHM identifier. A parameter linked with the repository dictionary is added in the calculation algorithm. The dictionary is parametric and contains one parameter.
Add links to the Algo, Metabase, Ms, Transform system assemblies. Add a link to the assembly required to work with the calculation algorithm.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObjectDescriptor;
Algo: ICalcObject;
CalcAlgo: ICalcAlgorithm;
MetaModel: IMsMetaModel;
Params: IMsModelParams;
Param: ITsModelParam;
ParamValues: IMetabaseObjectParamValues;
Begin
MB := MetabaseClass.Active;
// Get calculation algorithm
MObj := MB.ItemById("ALGORITHM");
Algo := CalcObjectFactory.CreateCalcObject(MObj, True);
CalcAlgo := Algo As ICalcAlgorithm;
// Get calculation algorithm parameters
MetaModel := CalcAlgo.MsProblem.MetaModel;
Params := MetaModel.Params;
Debug.WriteLine("Number of parameters: " + Params.Count.ToString);
If Params.Count > 0 Then
// Get calculation algorithm parameter
Param := Params.Item(0) As ITsModelParam;
// Parameter values for the dictionary, with which calculation algorithm parameter is linked
ParamValues := Param.LinkedObjectParams;
If ParamValues.Count > 0 Then
ParamValues.Item(0).Value := 1;
End If;
// Save changes
CalcAlgo.SaveObject;
End If;
End Sub UserProc;
After executing the example, the parameter value is set that is required to open the dictionary linked with the calculation algorithm parameter.
See also: