Main Content

safetyAnalysisMgr.getCurrentSelection

R2026b

Get current selection in Safety Analysis Manager document

Since R2023b

Description

value = safetyAnalysisMgr.getCurrentSelection returns the selected items in the Safety Analysis Manager.

example

Examples

collapse all

Suppose you have a spreadsheet open in the Safety Analysis Manager, and you select the cell in the second row and second column. Retrieve the SpreadsheetCell object in the spreadsheet.

myValue = safetyAnalysisMgr.getCurrentSelection
myValue = 

  SpreadsheetCell with properties:

            Row: 2
         Column: 2
    ColumnLabel: 'Label2'
          Value: 'text in cell'
    Description: ''

Suppose you have a spreadsheet open in the Safety Analysis Manager, and you select two cells. Retrieve the SpreadsheetCell objects in the spreadsheet.

myValue = safetyAnalysisMgr.getCurrentSelection
myValue = 

  1×2 SpreadsheetCell array with properties:

    Row
    Column
    ColumnLabel
    Value
    Description

Since R2024b

Suppose you have a spreadsheet open in the Safety Analysis Manager, and you select two rows. Retrieve the SpreadsheetRow objects in the spreadsheet.

myValue = safetyAnalysisMgr.getCurrentSelection
myValue =  

  1×2 SpreadsheetRow array with properties:

    Index
    Cells
    Description

Output Arguments

collapse all

Spreadsheet cells, returned as a SpreadsheetCell object array (since R2023b), SpreadsheetRow object array (since R2024b), heterogeneous array of Event and Gate objects, or an array of FailureModel objects (since R2026b).

Version History

Introduced in R2023b

expand all