Contenuto principale

getLinks

R2026b

Get links associated with spreadsheet cell or row in Safety Analysis Manager

Since R2023b

Description

Spreadsheets

links = getLinks(spreadsheetCell) returns the links associated with the spreadsheet cell, spreadsheetCell, in the Safety Analysis Manager.

You must have Requirements Toolbox™ to use this function.

example

links = getLinks(spreadsheetRow) returns the links associated with the specified spreadsheet row. (since R2024b)

example

Fault Tree Documents

links = getLinks(event) returns the links associated with the specified fault tree document event. (since R2026b)

example

links = getLinks(gate) returns the links associated with the specified fault tree document gate. (since R2026b)

example

links = getLinks(failureModel) returns the links associated with the specified fault tree document failure model. (since R2026b)

example

Examples

collapse all

Suppose that only one spreadsheet is loaded in the Safety Analysis Manager. Retrieve the Spreadsheet object of the spreadsheet.

mySpreadsheet = safetyAnalysisMgr.getOpenDocuments;

Retrieve the cell in the second row and the second column of the spreadsheet as a SpreadsheetCell object.

myCell = getCell(mySpreadsheet,2,2);

Retrieve the links assigned to the spreadsheet cell.

links = getLinks(myCell);

Since R2024b

Suppose that only one spreadsheet is loaded in the Safety Analysis Manager. Retrieve the Spreadsheet object of the spreadsheet.

mySpreadsheet = safetyAnalysisMgr.getOpenDocuments;

Retrieve the second row in the spreadsheet as a SpreadsheetRow object.

myRow = getRow(mySpreadsheet,2);

Retrieve the links assigned to the spreadsheet row.

links = getLinks(myRow);

Since R2026b

Suppose that one fault tree document is loaded in the Safety Analysis Manager. Retrieve the FaultTreeDocument object of the fault tree document.

myFaultTreeDoc = safetyAnalysisMgr.getOpenDocuments;

Check if the first event that you created in the fault tree document has links. Retrieve the event.

myEvent = myFaultTreeDoc.Events(1);

Retrieve the links assigned to the event.

links = getLinks(myEvent);

Since R2026b

Suppose that one fault tree document is loaded in the Safety Analysis Manager. Retrieve the FaultTreeDocument object of the fault tree document.

myFaultTreeDoc = safetyAnalysisMgr.getOpenDocuments;

Get the first fault tree from the fault tree document.

myFaultTree = myFaultTreeDoc.FaultTrees(1);

The first gate for a fault tree is the top-level gate. Retrieve the gate.

myGate = myFaultTree.Gates(1);

Retrieve the links assigned to the gate.

links = getLinks(myGate);

Since R2026b

Suppose that one fault tree document is loaded in the Safety Analysis Manager. Retrieve the FaultTreeDocument object of the fault tree document.

myFaultTreeDoc = safetyAnalysisMgr.getOpenDocuments;

Check if the failure model assigned to the first event that you created in the fault tree document has links. Retrieve the event.

myEvent = myFaultTreeDoc.Events(1);

Each event has a failure model. Retrieve the failure model.

myFailureModel = myEvent.FailureModel;

Retrieve the links assigned to the failure model.

links = getLinks(myFailureModel);

Input Arguments

collapse all

Cell in the Safety Analysis Manager spreadsheet, specified as a SpreadsheetCell object.

Row in the Safety Analysis Manager spreadsheet, specified as a SpreadsheetRow object.

Event in the Safety Analysis Manager fault tree document, specified as an Event object.

Gate in the Safety Analysis Manager fault tree document, specified as a Gate object.

Failure model in the Safety Analysis Manager fault tree document, specified as a FailureModel object.

Output Arguments

collapse all

Links to and from the document element, returned as a structure with two fields that each contain a slreq.Link object array:

  • inLinks – Incoming links to the document element

  • outLinks – Outgoing links from the document element

For more information about creating links to spreadsheet cells and rows in the Safety Analysis Manager, see Link Safety Analysis Manager Spreadsheet Cells and Rows to Requirements, Tests, and Faults.

For more information about creating links to fault tree events, gates, and failure models in the Safety Analysis Manager, see Link Safety Analysis Manager Fault Tree Artifacts to Requirements, Tests, and Faults.

Version History

Introduced in R2023b

expand all