Main Content

Simulink.allBlockDiagrams

R2026b

Find loaded Simulink models and libraries

Description

bd = Simulink.allBlockDiagrams() returns all loaded models and libraries.

bd = Simulink.allBlockDiagrams(type) returns either models or libraries.

example

Examples

collapse all

Get the handles of all loaded models in the current Simulink® session with unsaved changes, excluding libraries.

Get the handles of all loaded models, excluding libraries.

h = Simulink.allBlockDiagrams("model");

From the output, extract the handles of the models that have unsaved changes. Use the bdIsDirty function to check whether a model has unsaved changes. If a model has unsaved changes, the bdIsDirty function outputs a value of 1. If not, the bdIsDirty function outputs 0.

hDirty = h(bdIsDirty(h)==1);

Input Arguments

collapse all

Option of whether to return only models or only libraries, specified as "model" or "library".

Data Types: string | character vector

Output Arguments

collapse all

Loaded models and libraries, returned as an array of handles.

Data Types: double | array of doubles

Version History

Introduced in R2018a