Main Content

safetyAnalysisMgr.closeAllDocuments

R2026b

Close documents in Safety Analysis Manager

Since R2023b

Description

safetyAnalysisMgr.closeAllDocuments closes the documents in the Safety Analysis Manager. You must save the documents before you use this function.

example

safetyAnalysisMgr.closeAllDocuments(Force=status) closes the documents without saving when status is true. If status is false, you must save the documents before you use this function.

example

Examples

collapse all

Suppose you have two spreadsheet files, mySpreadsheet.mldatx and mySpreadsheet2.mldatx.

Open the Safety Analysis Manager.

safetyAnalysisMgr.openManager

Load both spreadsheets into the Safety Analysis Manager.

safetyAnalysisMgr.openDocument("mySpreadsheet.mldatx");
safetyAnalysisMgr.openDocument("mySpreadsheet2.mldatx");

Retrieve the Spreadsheet objects of the spreadsheets.

mySpreadsheets = safetyAnalysisMgr.getOpenDocuments;

Add a text column to each spreadsheet.

addColumn(mySpreadsheets(1))
addColumn(mySpreadsheets(2))

Save the spreadsheet updates.

save(mySpreadsheets(1))
save(mySpreadsheets(2))

Close the spreadsheets and keep the Safety Analysis Manager open.

safetyAnalysisMgr.closeAllDocuments

Since R2026b

Suppose you have two fault tree document files, myFaultTreeDoc.mldatx and myFaultTreeDoc2.mldatx.

Load both fault tree documents into the Safety Analysis Manager.

safetyAnalysisMgr.openDocument("myFaultTreeDoc.mldatx");
safetyAnalysisMgr.openDocument("myFaultTreeDoc2.mldatx");

Retrieve the FaultTreeDocument objects of the fault tree documents.

myFaultTreeDocs = safetyAnalysisMgr.getOpenDocuments;

Retrieve the first fault tree from each fault tree document.

myFaultTree = myFaultTreeDoc(1).FaultTrees(1);
myFaultTree2 = myFaultTreeDoc(2).FaultTrees(1);

Add a basic event to the top-level event in each fault tree.

createEvent(myFaultTree)
createEvent(myFaultTree2)

Save the fault tree documents.

save(myFaultTree)
save(myFaultTree2)

Close the fault tree documents and keep the Safety Analysis Manager open.

safetyAnalysisMgr.closeAllDocuments

Suppose you have two spreadsheet files, mySpreadsheet.mldatx and mySpreadsheet2.mldatx.

Open the Safety Analysis Manager.

safetyAnalysisMgr.openManager

Load both spreadsheets into the Safety Analysis Manager.

safetyAnalysisMgr.openDocument("mySpreadsheet.mldatx");
safetyAnalysisMgr.openDocument("mySpreadsheet2.mldatx");

Retrieve the Spreadsheet objects of the spreadsheets.

mySpreadsheets = safetyAnalysisMgr.getOpenDocuments;

Add a text column to each spreadsheet.

addColumn(mySpreadsheets(1))
addColumn(mySpreadsheets(2))

Close the spreadsheets without saving and keep the Safety Analysis Manager open.

safetyAnalysisMgr.closeAllDocuments(Force=true)

Input Arguments

collapse all

Whether documents can close without saving, specified as a numeric or logical 1 (true) or 0 (false).

Data Types: logical

Version History

Introduced in R2023b

expand all