IMsModel.AutoName

Syntax

AutoName: Boolean;

Description

The AutoName property determines whether to generate the model name automatically.

Comments

Available values:

Example

Executing the example requires that the repository contains a modeling container with the MODEL_SPACE identifier. The modeling container must contain a model with the MODEL_LIN identifier.

Add links to the Metabase, Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    DescrCM: IMetabaseObjectDescriptor;
    pModel: IMsModel;
    pGen: IMsModelStringGenerator;
Begin
    mb := MetabaseClass.Active;
    DescrCM := mb.ItemById("MODEL_SPACE");
    pModel := mb.ItemByIdNamespace("MODEL_LIN", DescrCM.Key).Edit As IMsModel;
    Debug.WriteLine("Name of the model before generation: '" + (pModel As IMetabaseObject).Name + "'");
    pModel.AutoName := True;
    pModel.UseModelPeriod := True;
    pGen := pModel.CreateStringGenerator;
    pGen.ShowEstimatedCoeffs := False;
    pGen.ShowFullVariableNames := True;
    pGen.HideModelPeriods := False;
    Debug.WriteLine("Name of the model with full names " +
        "variables and calculation period: '" + pGen.Execute + "'");
    pGen.ShowFullVariableNames := False;
    pGen.HideModelPeriods := True;
    Debug.WriteLine("Name of the model with elements names " +
        "expressions and without calculation period: '" + pGen.Execute + "'");
    (pModel As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the model name is generated automatically. The name of the model before and after automatic generation by different parameters will be displayed in the console window. For example:

Name of the model before generation: 'MODEL_LIN'
Name of the model with full names of variables and calculation period: 'Price level[t] = A0 + A1*Gas prices[t] + A2*Seasonal fluctuations[t] + [AR(1)=A3], (Start of data)-(From the end of sample+10)'
Name of the model with names of elements of expression and without calculation period: 'Y = A0 + A1*X1 + A2*X2 + [AR(1)=A3]'

See also:

IMsModel