Selection: IDimSelectionSet;
The Selection property determines the object containing slice selection.
Executing the example requires a model in the modeling container. The model contains input variables with additional dimensions.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Model: IMsModel;
Slice: IMsFormulaTransformSlice;
TransVar: IMsFormulaTransformVariable;
i: Integer;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemByIdNamespace("NEW_NONLINREG", MB.ItemById("KONT_MODEL").Key).Edit;
Model := MObj As IMsModel;
TransVar := Model.Transform.Inputs.Item(0);
Slice := TransVar.Slices.Item(0);
For i := 0 To Slice.Selection.Count - 1 Do
Slice.Selection.Item(i).DeselectAll;
Slice.Selection.Item(i).SelectElement(0, True);
End For;
MObj.Save;
End Sub Main;
After executing the example a selection of all the additional dimensions is modified for the first input variable in the model with the NEW_NONLINREG identifier.
See also: