Customising the Dymola environment

June 17th, 2016 by Mahdieh Mehrabi

Options to customize the Dymola environment.

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

Figure 1 _ Model considered changed because of a white space

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

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);

 

By: Romain Gillot – Project Engineer

Archives

2017

2016

2015

2013

2012

2011

2010