Main Content


(To be removed) Manipulate current project at command line

slproject.getCurrentProject will be removed in a future release. Use currentProject instead.



proj = slproject.getCurrentProject gets the current project open in the 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.


slproject.getCurrentProject is replaced by slproject.getCurrentProjects.


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 project at the command line.

Version History

Introduced in R2013a