The Dymola Startup Configuration

This post describes how to configure Dymola so that on startup you can set the directory, load a library and set other features.

When Dymola is started the dymola.mos file is run at startup (i.e. <Dymola installation directory>insertdymola.mos).  By default the script should look something like this:

Default dymola.mos file

The RunScript command runs displayunit.mos script which is used to control the unit conversions in Dymola, for more information goto here .  By uncommenting the line // RunScript(“$DYMOLA/insert/displayunit_us.mos”,true);  the US units will be loaded.

A number of useful tasks and setting can be added to this script:

  • Setting the current directory
    Add cd(<pathName>) where pathName is the path that you want to start in.
  • Set the number of files to store in Recent Files
    Add Advanced.MaxRecentFiles = 9;
  • Enable the Autoformating feature
    Add Advanced.AutoFormatting = true;  This activates the automatic formatting so that when you press Ctrl+L the code is automatically formatted and should look easier to read.
  • Open a model
    For example add openModel(“C:/Users/Public/Documents/ClaytexLibraries/Engines/package.moe”); 
  • Run .mos scripts
    Use RunScript(<scriptName>) to run a script.

Note that when changing the dymola.mos file you may find that the Windows will not allow you to change modify the dymola.mos file.  A workaround that is to save the modified dymola.mos file to the Desktop and then to replace the script in <Dymola installation directory>insert directory.  If this does not work then please consult your IT personnel.

An example of a modified dymola.mos is below:

Example dymola.mos file

 

Related articles:

Changing the default font size
Adding additional units

 

CONTACT US

Got a question? Just fill in this form and send it to us and we'll get back to you shortly.

Sending

© Copyright 2010-2017 Claytex Services Ltd All Rights Reserved. | Designed by CMA Marketing

Log in with your credentials

Forgot your details?