Importing Modelica Libraries - MapleSim Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim

Importing Modelica Libraries

If you used a third-party tool to create model libraries in the Modelica 4.0.0 programming language, you can import the .mo files of those model libraries into MapleSim as a custom library. You can then use the imported components in your MapleSim models.

Your library can be either a structured entity (a library that is split into files and folders inside a folder) or a nonstructured entity (a single .mo file that contains the full library).

The folders and files in your library must adhere to the Modelica specifications. In particular, the following must be true:


Each folder in a structured entity must contain a file and the name of the top-level class in the file must match the name of the folder.


For .mo files not named, there can only be one top-level class in the .mo file and the name of the top-level class must match the name of the file. This holds for both structured entities and nonstructured entities.

When importing a library from a structured entity, any sub-entities contained within the structured entity are considered part of the library and are also loaded. Similarly, if you try to import a sub-entity of the library, the entire library is imported and not just the sub-entity.

When importing a library from a nonstructured entity, the .mo file cannot be stored in either a directory that contains a file or a subdirectory of a structured entity. In both cases, the .mo file is considered a sub-entity of a larger library and the larger library is loaded along with the .mo file.

To import a Modelica library:


From the File menu, select Import Modelica... to open the Select Modelica file to import dialog box.


Browse to the location of the Modelica library, select the Modelica file that represents the root of your Modelica library, and then click Open.

The Creating Library dialog box appears. It displays the progress of the library import.


After the import is complete, click Close.

Under the Library Components tab ( ) you will find a new palette with the same name as the top-level class for your library. The components in the palette can be used in your MapleSim models. The custom palette will automatically appear in future MapleSim sessions.



You can replace an imported Modelica library with an updated version by reimporting the library.


It is possible to import Modelica models and model libraries that are based on the Modelica 3.2.3 programming language. However, for optimal results, it is recommended that you import .mo files that are written in the Modelica 4.0.0 programming language only.

See Also

Creating a Custom Library

Exporting a Model to a Modelica File

Hiding or Deleting a Custom Library

Model Workspace Toolbar

Opening Modelica Models