Documentation

slproject.getCurrentProject

Manipulate current Simulink Project at command line

Syntax

  • proj = slproject.getCurrentProject
    example

Description

example

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.

Examples

collapse all

Get Airframe Example Project

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

sldemo_slproject_airframe
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

proj — Projectproject object

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?