How do I make my library appear in the libraries menu

To get your library to appear in the Dymola Libraries menu you first need to make sure that your library is saved using the directories method rather than as a single Modelica file.  See here for more information.

Create a directory called script inside your library directory and within the script directory, create a text file called libraryinfo.mos. Edit this file using a text editor and add the LibraryInfoMenuCommand.  An example of how to use this command is below:

  reference="HyLib ",
  description="Hydraulics library",
  ModelicaVersion=">= 2"


The arguments in this command have the following meaning:

  • Category determines where in the File menu the item will appear, libraries or de-mos.
  • text is the text that will appear in the library menu.
  • reference is the package name.
  • isModel is true if item is a model or library.
  • description is a description of the library and will appear at the bottom right of the Dymola window when you put the mouse over the item in the libraries menu.
  • version is the version number of the library to be loaded
  • ModelicaVersion is used by Dymola to filter the contents of the libraries menu based on the Modelica Standard Library version opened.
  • pos sets the position of the library link in the library menu.

For more detailed information refer to Section 6.1.5 in Dymola User Manual Volume 1.

This was written using Dymola 2016 FD01.

Please note that for this to work the library must either be in the <Dymola>ModelicaLibrary directory or within a directory specified in the MODELICAPATH environmental variable.


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


© Copyright 2010-2024 Claytex Services Ltd All Rights Reserved

Log in with your credentials

Forgot your details?