Exporting a Model to Source Code and to Binary

This section describes how to export a model in a format suitable for use with other computers or in other external environments.


Before you begin:
  • Ensure you have the correct CATIA licenses installed:
    To export to This license is required License product code
    Source Code Source Code Generation XSC
    Binary Binary Export XBM

    For further information on licensing, refer to the Dassault Systemes License Server Essentials Guide.

  • Create a folder E:/Export.
Related Topics
About Exporting Models
Installing 3D XML Modelica Libraries in the Dynamic Behavior Modeling Workbench
Editing Modelica Text
  1. Install the Modelica library ExternalInterfaces.

    This library is in the file ExternalInterfaces_*.3dxml which is located in your install repository (typically \intel_a\resources\3DXMLData\). If necessary, refer to Related Topics for help on installing libraries.

    The ExternalInterfaces library is added to the list in the Package Browser.

  2. From the Package Browser select ExternalInterfaces > Export.



  3. To export to Source Code, do one of the following:

    • In the tree under Export, click toCcode and then in the menu bar select Edit > toCcode (x) object > Call Function...
    • In the tree under Export, right-click toCcode and then select toCcode (x) object > Call Function...

    The ExternalInterfaces.Export.toCcode dialog box is displayed.

  4. To export to Binary, do one of the following:

    • In the tree under Export, click toBinary and then in the menu bar select Edit > toBinary (x) object > Call Function...
    • In the tree under Export, right-click toBinary and then select toBinary (x) object > Call Function...

    The ExternalInterfaces.Export.toBinary dialog box is displayed.

  5. In the Model name area of the dialog box, click and in the Select Model dialog box which appears select the model you want to export and then click OK.

    If you click the arrow at the end of an input field you can also Edit Text in a separate dialog box and Copy Default values. The default value is specified in the text view of the function; for example the default value for the exportDirectory parameter is given by input String exportDirectory= "" (see Related Topics for more information about editing Modelica text).

    The model name is added to the dialog box.

  6. In the Export directory area of the dialog box, enter "E:/Export".

    In this example, the data for Modelica.Mechanics.Rotational.Examples.CoupledClutches will be exported to the E:/Export folder.

    Export to Source Code Export to Binary




  7. Do one of the following:

    • Click OK: The export function is started and when it has finished the dialog box closes.
    • Click Info: A dialog box is displayed which gives a summary of the export parameters.
    • Click Execute: The export function is started and when it has finished the dialog box remains open.
    • Click Copy Call: The export function and its parameters are copied to the clipboard. You can then paste them into the scripting command window or into a script (.mos) file.
    • Click Close: The export function is dismissed and the dialog box closes.

    If you click OK or Execute:

    1. The Modelica Scripting Window dialog box is displayed and shows the status of the function.
    2. The results are computed and exported.

The exported files are saved in the Export directory you specified. Typical results files are listed below:

Export to Source Code Export to Binary
buildlog.txt buildlog.txt
dsin.txt dsin.txt
dsmodel.c dsmodel.c
dymosim.exe  
dymosim.exp dymosim.exp
dymosim.lib dymosim.lib
dymosimg.exe  

Note: The simulation run-time code added to the exported file dsmodel.c does not contain the most advanced routines from the binary link libraries. It is therefore, for instance, not possible to export models with dynamic state selection.