Customising the Dymola environment

By: Romain Gillot – Project Engineer

Options to customize the Dymola environment.

If you click on Edit -> Options, a number of options are available to customise the working environment.

  • Manual formatting: the user can choose to use their own formatting or an automatic formatting. Automatic formatting can be useful for consistency and to avoid triggering a change in a model if only the format has changed. For example, automatic formatting removes the white spaces in the text; these can be considered as a change in a model. The two following models are thus considered as two different models.

Figure 1 _ Model considered changed because of a white space

Figure 1: Model considered changed because of a white space.

  • Base font size can also be changed

In the Save Settings tab, you can save the settings for the next session of Dymola.

Preload libraries.

It is possible to create a short script that opens Dymola and load the right libraries.

Figure 2 _ Short script to open Dymola and load the right libraries

Figure 2: Short script to open Dymola and load the right libraries.

To open more libraries, just add more lines starting with “openModel”.

Figure 3 _ Options menu

Figure 3: Options menu.

Custom menus for easy access to some commands.

It is possible for the user to introduce new menus and toolbars where functions can be called.

Figure 4_New menu My Functions with a submenu My Matrix Functions & 2 functions sin & cos

Figure 4: New menu My Functions with a submenu My Matrix Functions and two functions sin and cos.

To create such menu, write an annotation in the package that you want to appear in the new menu.

package MyFunctions "My Functions"
  package MyMatrixFunctions "My Matrix Functions"
    function solve = Modelica.Math.Matrices.solve (A=[1, 2; 3, 4], b={1,1});
    function eigenValues = Modelica.Math.Matrices.eigenValues "eigen values" 
     annotation (uses(Modelica(version="3.2")), 
        Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
        graphics={Line(
        points={{-100,-100},{-100,100},{0,0},{100,100},{100,-100}},
        color={0,0,255},
        smooth=Smooth.None,
        thickness=0.5)}));
  end MyMatrixFunctions;
  function sin = Modelica.Math.sin;
  function cos = Modelica.Math.cos;
  annotation (
    __Dymola_toolbar=true,
    __Dymola_menu=true,
    Protection(hideFromBrowser=true),
    Uses(Modelica(version="3.2"))); 
end MyFunctions;

The package structure is created by the annotation: annotation(__Dymola_menu=true);

Toolbars are created by the annotation: annotation(__Dymola_toolbar=true);

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?