Main Content

safetyAnalysisMgr.getCurrentSelection

Get current cell or row in Safety Analysis Manager spreadsheet

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 (since R2023b) or SpreadsheetRow (since R2024b) object array.

Version History

Introduced in R2023b

expand all