Main Content

RTW.getBuildDir

Get build folder information from model build information

Description

example

RTW.getBuildDir(model) displays build folder information for model.

If the model is closed, the function opens and then closes the model, leaving it in its original state. If the model is large and closed, the RTW.getBuildDir function can take longer to execute.

example

folderStruct = RTW.getBuildDir(model) returns a structure containing build folder information.

You can use this function in automated scripts to determine the build folder in which the generated code for a model is placed.

This function can return build folder information for protected models.

Examples

collapse all

Display build folder information for the model 'sldemo_fuelsys'.

openExample('sldemo_fuelsys');
RTW.getBuildDir('sldemo_fuelsys')
ans = 

              BuildDirectory: 'C:\work\modelref\sldemo_fuelsys_ert_rtw'
                 CacheFolder: 'C:\work\modelref'
               CodeGenFolder: 'C:\work\modelref'
            RelativeBuildDir: 'sldemo_fuelsys_ert_rtw'
              BuildDirSuffix: '_ert_rtw'
  ModelRefRelativeRootSimDir: 'slprj\sim'
  ModelRefRelativeRootTgtDir: 'slprj\ert'
    ModelRefRelativeBuildDir: 'slprj\ert\sldemo_fuelsys'
      ModelRefRelativeSimDir: 'slprj\sim\sldemo_fuelsys'
      ModelRefRelativeHdlDir: 'slprj\hdl\sldemo_fuelsys'
           ModelRefDirSuffix: ''
           SharedUtilsSimDir: 'slprj\sim\_sharedutils'
           SharedUtilsTgtDir: 'slprj\ert\_sharedutils'

Return a structure my_folderStruct that contains build folder information for the model 'MyModel'.

>> my_folderStruct = RTW.getBuildDir('MyModel')

my_folderStruct = 

              BuildDirectory: 'H:\MyModel_ert_rtw'
                 CacheFolder: 'H:\'
               CodeGenFolder: 'H:\'
            RelativeBuildDir: 'MyModel_ert_rtw'
              BuildDirSuffix: '_ert_rtw'
  ModelRefRelativeRootSimDir: 'slprj\sim'
  ModelRefRelativeRootTgtDir: 'slprj\ert'
    ModelRefRelativeBuildDir: 'slprj\ert\MyModel'
      ModelRefRelativeSimDir: 'slprj\sim\MyModel'
      ModelRefRelativeHdlDir: 'slprj\hdl\MyModel'
           ModelRefDirSuffix: ''
           SharedUtilsSimDir: 'slprj\sim\_sharedutils'
           SharedUtilsTgtDir: 'slprj\ert\_sharedutils'

Input Arguments

collapse all

Model for which to get the build folder, specified as an object or a character vector representing the model name.

Example: 'sldemo_fuelsys'

Output Arguments

collapse all

Structure with fields that provides build folder information.

Example: folderstruct = RTW.getBuildDir('MyModel')

Version History

Introduced in R2008b