getSelectedItems(TreeControl)

Class: Simulink.dialog.TreeControl
Package: Simulink.dialog

Get the values of selected items from a tree hierarchy

Syntax

selectedItems = treeControl.getSelectedItems()

Description

selectedItems = treeControl.getSelectedItems() fetches the information of the selected items in the tree.

Output Arguments

expand all

Value of the selected items, returned as a cell array.

Examples

% Get block mask handle
maskObj = Simulink.Mask.get(gcb); 

% Get tree handle
treeControl = maskObj.getDialogControl('TreeControl');
treeControl.getSelectedItems();



ans =

  4×1 cell array

    {'Node1/ChildNode1'}
    {'Node1/ChildNode2'}
    {'Node2/ChildNode1'}
    {'Node2/ChildNode2'}

Introduced in R2019b