createLabel

Class: Simulink.ModelManagement.Project.CurrentProject
Package: Simulink.ModelManagement.Project

(To be removed) Create a label in a category in the currently open Simulink project

    Note:   Simulink.ModelManagement.Project.CurrentProject.createLabel will be removed in a future release. Use createLabel instead.

Syntax

p = Simulink.ModelManagement.Project.CurrentProject()
labelObj = Simulink.ModelManagement.Project.Label(categoryName,labelName);
p.createLabel(labelObj)

Description

p = Simulink.ModelManagement.Project.CurrentProject() creates an instance of the CurrentProject class.

labelObj = Simulink.ModelManagement.Project.Label(categoryName,labelName); creates a label object named labelObj for the category categoryName.

p.createLabel(labelObj) creates the label in the category.

If the category for the new label does not exist, it is created with the label object.

Input Arguments

categoryName

The name of the category in which the new label is to be added.

labelName

The name of the new label.

Examples

To create a new label John in category Owner in the currently open Simulink project, use the following commands.

  1. Create an instance of the CurrentProject class.

    p = Simulink.ModelManagement.Project.CurrentProject();
  2. Create a label object.

    labelObj= Simulink.ModelManagement.Project.Label('Owner','John');
  3. Add the label to the category.

    p.createLabel(labelObj);
Was this topic helpful?