getCheckInstanceIDs

Class: Advisor.Application
Package: Advisor

Obtain check instance IDs

Description

Obtain the check instance ID for a check using the check ID. A check instance is an instantiation of a ModelAdvisor.Check object in the Model Advisor configuration. When you change the Model Advisor configuration, the check instance ID might change. The check ID is a static identifier that does not change.

example

CheckInstanceIDs = getCheckInstanceIDs(app) returns a cell array of IDs.

example

CheckInstanceIDs = getCheckInstanceIDs(app,CheckID) returns a instance ID for a check.

Input Arguments

expand all

Advisor.Application object, created by Advisor.Manager.createApplication

Check ID associated with Model Advisor check.

Example: 'mathworks.design.UnconnectedLinesPorts'

Output Arguments

expand all

Check instance IDs, returned as a cell array of IDs

Examples

expand all

This example shows how to set the root model, create an Application object, set root analysis, and obtain the check instance ID.

% Set root model to sldemo_mdlref_basic model
RootModel='sldemo_mdlref_basic';

% Create an Application object
app = Advisor.Manager.createApplication();

% Set the Application object root analysis
setAnalysisRoot(app,'Root',RootModel);

% Select all check instances
selectCheckInstances(app);

% Obtain check instance IDs
CheckInstanceIDs = getCheckInstanceIDs(app);

This example shows how to set the root model, create an Application object, set root analysis, and obtain the check instance ID for check Identify unconnected lines, input ports.

% Set root model to sldemo_mdlref_basic model
RootModel='sldemo_mdlref_basic';

% Create an Application object
app = Advisor.Manager.createApplication();

% Set the Application object root analysis
setAnalysisRoot(app,'Root',RootModel);

% Select all check instances
selectCheckInstances(app);

%  Obtain check instance ID for Model Advisor check "Identify unconnected lines, 
%   input ports"
CheckInstanceIDs = getCheckInstanceIDs(app,'mathworks.design.UnconnectedLinesPorts');

Alternatives

In the left-hand pane of the Model Advisor window, right-click the check and select Send Check Instance ID to Workspace.

Introduced in R2015b