Search code examples
contextmenumodelicadymola

How to make a context menu in dymola?


How can I make my own context menu in dymola? I want to do the same that I can in MATLAB, their I can do a context menu that is shown in the link: http://blogs.mathworks.com/pick/2011/05/20/add-a-list-of-favorite-blocks-to-the-simulink-context-menu/


Solution

  • I don't think you can create a custom menu, but you can create your own package of shortcuts to your most commonly used models. If you use the "__Dymola_shortcut" annotation, it should reproduce the functionality you're looking for. You can even include your preferred modifications to parameters if you like. There's an example of this in the User Manual ("7.2.3 Defining packages with users own collection of favorite models" - in the version I have), but is should work something like this:

    package MyFavoriteModels
          model MyFavoriteModel = Full.Path.to.My.Favorite.Model annotation(__Dymola_shortcut=true);
          model FavWithParam = Path.to.Another.Favorite(P=4) annotation(__Dymola_shortcut=true);
          ...
    end MyFavoriteModels;
    

    When you open your custom package it will be a flat list of the models you chose to include.