Documentation Center

  • Trial Software
  • Product Updates

detachLabelFromFile

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

(To be removed) Remove a label from a file in the currently open Simulink project

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

Syntax

p = Simulink.ModelManagement.Project.CurrentProject()
p.detachLabelFromFile(filePath,labelObj)

Description

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

p.detachLabelFromFile(filePath,labelObj) removes a label from a file specified using filePath using the label object labelObj .

Input Arguments

filePath

The fully qualified path to the file from which the label is to be removed.

labelObj

The label object used to remove the label from the file.

Example

To remove a label from a file labelled with review status Approved, use the following commands.

  1. Create an instance of the CurrentProject class.

    p = Simulink.ModelManagement.Project.CurrentProject();
  2. Create a fully qualified path for the file.

      Note:   The use of the getRootDirectory method in this step is optional.

    file = fullfile(p.getRootDirectory, 'work', 'myExample.c');
  3. Create a label object.

    labelObj = Simulink.ModelManagement.Project.Label('Review','Approved');
  4. Use the detachLabelFromFile method.

    p.detachLabelFromFile(file,labelObj);

See Also

Was this topic helpful?