Main Content

exportCustomFormat

Export RoadRunner scene to custom format using MATLAB

Since R2022a

    Description

    example

    exportCustomFormat(rrApp,filename,formatname) exports the current RoadRunner scene to a custom format specified using the ExportConfigurations.xml file. To specify a custom configuration, follow these steps:

    1. Create an XML file that configures the details of the custom export format.

    2. Save the XML file to the Project folder of the RoadRunner project that you want to contain the export option and name it ExportConfigurations.xml.

    For more details on creating the ExportConfigurations.xml file, see Export Custom Formats (RoadRunner).

    Examples

    collapse all

    Open a project in RoadRunner using the roadrunner function by specifying the location in which to create a project. This example assumes that RoadRunner is installed in its default location in Windows®.

    Specify the path to an existing project. For example, this code shows the path to a project located on C:\RR\MyProject. The function returns a roadrunner object, rrApp, that provides functions for performing basic workflow tasks such as opening, closing, and saving scenes and projects.

    projectFolder = "C:\RR\MyProject";
    rrApp = roadrunner(projectFolder);

    Open an existing scene in RoadRunner.

    filename = "FourWaySignal.rrscene";
    openScene(rrApp,filename);

    Create an ExportConfigurations.xml file to configure custom export format. Then, use the exportCustomFormat function to export the currently open RoadRunner scene to the custom format specified in the ExportConfigurations.xml file.

    customfilename = "customExport.zip";
    formatname = "My Custom Format";
    exportCustomFormat(rrApp,customfilename,formatname);

    Input Arguments

    collapse all

    RoadRunner application associated with a project, specified as a roadrunner object. This object provides functions for performing common workflow tasks such as opening, closing, and saving scenes and projects. rrApp provides functions that support importing data from files and exporting scenes to other formats from RoadRunner.

    File path for exported RoadRunner scene, specified as a character vector or string scalar. This argument specifies the absolute or relative file path for to the exported file. If you specify a relative path, then the exported file is saved relative to the Exports folder of the current project. If any folders in the specified path do not exist, RoadRunner tries to create them. filename must include the extension of the exported file.

    Example: "customExport.zip"

    Data Types: char | string

    Custom export format name, specified as a character vector or string scalar. This argument specifies the configuration name of your custom export format in the ExportConfigurations.xml file. The format name is case sensitive.

    Example: "My Custom Format"

    Data Types: char | string

    Version History

    Introduced in R2022a