Kind: MsModelKind;
The Kind property determines the model type.
Executing the example requires that the repository contains a modeling container with the MODEL_SPACE identifier. Modeling variable with the Var_1 identifier is present in this container. At least one additional dimension is added to the structure of the variable.
Add links to the Dimensions, Metabase, Ms system assemblies.
Sub UserProc;
Var
MB: IMetabase;
ModelSpace: IMetabaseObjectDescriptor;
CrInf: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
Model: IMsModel;
Transf: IMsFormulaTransform;
Var_1: IVariableStub;
TransfVar: IMsFormulaTransformVariable;
Dim: IDimensionModel;
Begin
MB := MetabaseClass.Active;
ModelSpace := Mb.ItemById("MODEL_SPACE");
CrInf := Mb.CreateCreateInfo;
CrInf.ClassId := MetabaseObjectClass.KE_CLASS_MSMODEL;
CrInf.Id := "New_Balance";
CrInf.Name := "New_Balance";
CrInf.Parent := ModelSpace;
MObj := Mb.CreateObject(CrInf).Edit;
Model := MObj As IMsModel;
Transf := Model.Transform;
Transf.Kind := MsModelKind.InterindustryBalance;
Var_1 := MB.ItemByIdNamespace("Var_1", ModelSpace.Key).Bind As IVariableStub;
TransfVar := Transf.Outputs.Add(Var_1);
Dim := Var_1.Dimension(0);
Transf.DimensionTransparent(TransfVar, Dim) := True;
MObj.Save;
End Sub UserProc;
After executing the example, a new model is created in the modeling container. Model type is input-output model. The specified variable is set as the end use variable.
See also: