CreateStringGenerator: IMsFormulaStringGenerator;
The CreateStringGenerator method creates a generator of string presentation of the method of calculation models.
Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier. The model with the Model identifier must be present in this container.
Sub Main;
Var
mb: IMetabase;
DescrCM: IMetabaseObjectDescriptor;
pModel: IMsModel;
Transform: IMsFormulaTransform;
pSelector: IMsFormulaTransformSelector;
pFormula: IMsFormula;
pGen: IMsFormulaStringGenerator;
Begin
mb := MetabaseClass.Active;
DescrCM := mb.ItemById("CONT_MODEL");
pModel := mb.ItemByIdNamespace("MODEL", DescrCM.Key).Bind As IMsModel;
Transform := pModel.Transform;
pSelector := Transform.CreateSelector;
pSelector.Slice := Transform.Outputs.Item(0).Slices.Item(0);
pFormula := Transform.Transform(pSelector);
pGen := pFormula.CreateStringGenerator;
pGen.ShowFullVariableNames := False;
Debug.WriteLine(Name of calculation model method after automatic generation: + pGen.Exeslicee +);
End Sub Main;
After executing the example the string view of model calculation method is generated and displayed inin the console window. For example:
Module execution started
Name of calculation model method after automatic generation: Y[t] = X1[t] * X2[t] + k
Module execution finished
See also: