Main Content

safetyAnalysisMgr.closeAllDocuments

Close documents in Safety Analysis Manager

Since R2023b

Description

example

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 document without saving when status is true. If status is false, you must save the documents before you use this function.

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

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