This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Manipulate current Simulink Project at command line


proj = slproject.getCurrentProject



proj = slproject.getCurrentProject gets the current project open in the Simulink® Project Tool and returns a project object proj that you can use to manipulate the project programmatically. If no project is open, then you see an error.

    Note:   slproject.getCurrentProject will be removed in a future release. Use slproject.getCurrentProjects instead.


collapse all

Open the Airframe project and use slproject.getCurrentProject to get a project object to manipulate the project at the command line.

proj = slproject.getCurrentProject
proj = 

  ProjectManager with properties:

          Name: 'Simulink Project Airframe Example'
           Categories: [1x1 slproject.Category]
            Shortcuts: [1x8 slproject.Shortcut]
          ProjectPath: [1x7 slproject.PathFolder]
    ProjectReferences: [1x0 slproject.ProjectReference]
                Files: [1x30 slproject.ProjectFile]
           RootFolder: 'C:\Work\Simulink\Projects\slexamples\airframe'

Output Arguments

collapse all

Project, returned as a project object. Use the project object to manipulate the currently open Simulink Project at the command line.

Introduced in R2013a

Was this topic helpful?