Main Content

padv.util.getCurrentProject

Get current project and persist project instance

    Description

    cp = padv.util.getCurrentProject() gets the currently open project, and returns a project object, cp. You can use this function to get the current project in your code, for example, in custom queries. This function can be faster than the currentProject function because cp is a persistent variable.

    This functionality requires CI/CD Automation for Simulink Check.

    example

    Examples

    collapse all

    Get the current project, represented by a matlab.project.Project object.

    Open the Process Advisor example project.

    processAdvisorExampleStart

    Get the current project.

    cp = padv.util.getCurrentProject()

    Output Arguments

    collapse all

    Current project, returned as a matlab.project.Project object. cp is a persistent variable that can remain in memory between calls to the function.

    If you do not have a project open, then the function returns an empty array.