To generate a simulation file, right-click the Block corresponding the system being simulated (see the image below).
![SysML Plugin 2021x Refresh1 > Generating simulation files > Export_To_Simulink_And_Modelica.png](/download/attachments/70407556/Export_To_Simulink_And_Modelica.png?version=1&modificationDate=1557209078051&api=v2)
To export to Modelica and Simulink
- Depending on the selected option (either Export to Modelica or Export to Simulink), do one of the following:
- Specify options such as output directory, how to export unannotated SysML properties, and whether diagram layout annotations should be generated on export.
![SysML Plugin 2021x Refresh1 > Generating simulation files > modelica_export_options_.png](/download/attachments/70407556/modelica_export_options_.png?version=1&modificationDate=1581322668989&api=v2)
- Specify options such as format, output directory, S-Function or Simscape, Simscape port libraries, and whether to apply the <<SimulinkBlock>> stereotype.
![SysML Plugin 2021x Refresh1 > Generating simulation files > simulink_export_new_dialog (1).png](/download/attachments/70407556/simulink_export_new_dialog%20%281%29.png?version=1&modificationDate=1581322715179&api=v2)
- Click OK.