Opening Script – Library Version Management

Introduction:

Library version management is an important topic for Dymola developers. On occasions we experience warnings when opening a model sent by a colleague/customer when an alternative version of a required library is automatically opened. Scripting in Dymola is a handy way to do many things. This post outlines how it can be used to eliminate those library version mismatch errors when utilising third party libraries. This post covers a similar topic as one written previously about creating a function to open libraries.

Often, Dymola developers utilise libraries produced by third parties (such as Claytex) or even other groups within their company. It isn’t uncommon for multiple versions of each library to exist on the developer’s computer. Getting Dymola to automatically load the desired version is therefore a desired outcome. If an undesired library version is automatically loaded you can simply right click on the library in question and ‘unload’ it:

Unload library

…then in the File menu, ‘Load’ the version to be used… but for those of us using Dymola on a day to day basis it would be nice to avoid these few extra clicks.

The Fix – Prescribed opening Script:

I now use a file opening script to guarantee the required library versions are opened. This script opens up the specific libraries / versions that are needed for the task at hand. Below is an example script that I use to prepare my Dymola environment by loading the libraries that I use on a day to day basis:

example script to prepare Dymola environment

If I’m testing a particular installation of the Claytex libraries, I will use a different script. The one below opens up libraries from the Claytex installer location rather than the source code directory setup shown above. Both end by specifying the working directory we wish to use.

This script opens up libraries from the Claytex installer location.

Closing:

In closing, using a script to prepare your Dymola environment can make the Dymola developer’s life a little easier. Many commands can be added to these scripts. Consider using the script editor in Dymola and typing Ctrl+ Space to see some more commands that may be of use to you. If you are interested in a list of more advanced options, type this in the command prompt:

list(variables={“Advanced.*”})

Written by: Nate Horn – Vice President

 

Please get in touch if you have any questions or have got a topic in mind that you would like us to write about. You can submit your questions / topics via: Tech Blog Questions / Topic Suggestion.

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-2018 Claytex Services Ltd All Rights Reserved. | Designed by CMA Marketing

Log in with your credentials

Forgot your details?