Navigating the Package and Component Browsers

New versions of Dymola are released every 6 months , and it can be easy to miss some of the more subtle changes between releases. So, this blog post is all about one such change you may have missed, the differences in the Package and Component Browsers in Dymola 2019 FD01 compared to previous versions and how these could make things a little easier to navigate.

Spot the Difference

When I open Dymola 2019 and Dymola 2019 FD01 side by side, as shown in figure 1, it’s clear to see that changes have been made to the Package and Component Browsers with the addition of new editable fields and buttons. But what do these allow me to do?

Comparison of the Package and Component Browsers in Dymola 2019 and Dymola 2019 FD01 showing the differences
Figure 1 – Comparison of the Package and Component Browsers in Dymola 2019 and Dymola 2019 FD01 showing the differences

Filtering in the Package Browsers

The editable fields at the top of the Package and Component Browsers are actually filter inputs, just start typing in them to start the search.

So, if I wanted to search for all the output connectors in the libraries I have open, I enter output into the filter field for the Package Browser. The filter will take me to the first matching class in the Package Browser; any exact matches are shown first. I can move through all the matches using the up and down arrows while the cursor is still in the filter. If I enter Ctrl+Enter the selected match will be displayed in the modelling window.

It is easier to compare the classes matching my filter if only the matches are shown in the Package Browser. I can do this by selecting the first button to the right of the filter field, as highlighted in figure 2, called Show only matching classes.

Using the filter field to search the Package Browser, and using the Show only matching classes button
Figure 2 – Using the filter field to search the Package Browser, on the right only matching classes shown using the button highlighted

The filter is not case sensitive by default. However if I wanted it to be case sensitive, I can right click in the filter field to open its context menu and select the option Match Case.

I can also search for Modelica paths using the filter field. So, if I enter a complete Modelica path into the filter, like Modelica.Blocks.Continuous.PID, it will take me directly to that class (as long as the path exists of course, it can’t work miracles). I can also enter an incomplete Modelica path, such as Modelica.Mechanics.MultiBody.Parts.B , which will filter to anything starting with B in the package Modelica.Mechanics.MultiBody.Parts.

Loading Libraries from the Package Browser Filter

The Package Browser filter field can also be used to load additional libraries, as shown in the video below, which can be very useful. To do this I need to first enable it by going to the Edit menu, then Options…, and in the Package Browser tab select the checkbox next to Filter can automatically load libraries. So, now I can enter VeSyMA.Experiments in to the filter field, the VeSyMA library will be loaded and the Experiments package navigated to.

Figure 3 – Video showing how to load libraries from the Package Browser

For this to work, the library being loaded from the Package Browser filter needs to be included in the Modelica Path for Dymola to find it.

Filtering in the Component Browsers

The Component Browser also has a filter field. This filter is used to search through the components in a model; figure 4 shows my search for the revolute in the Modelica Standard Library double pendulum example.

Component Browser filter being used to search the components in a model
Figure 4 – Using the Component Browser filter to search from a revolute component in the model

Like the Package Browser filter, I can move between the matching components using the arrow keys. If I use Ctrl+ Enter while a match is selected it is equivalent to using Show Component, and will show the component model in the modelling window. Right clicking in the Component Browser filter field allows me to make the filter case sensitive by selecting the Match Case option in the context menu.

Package and Component Browsers Buttons

The Package and Component Browsers now have buttons controlling how the content is displayed, as highlighted in the image below.

Package and Component Browser Buttons
Figure 5 – Buttons for the Package and Component Browsers

Both the Package and Component Browsers have a sort by button, where I can choose to sort by declaration order defined by the library developer, alphabetical order A to Z or alphabetical order Z to A.

For the Package Browser, there is a button to collapse all the expanded packages.

The Component Browser now has a button to include non-graphical component, which will show/hide variable declarations in the Component Browser.

The End….

So the next time you open Dymola, try using the new filter and buttons in the Package and Component Browsers to make finding the model or component you are interested in easier.

Written by: Hannah Hammond-Scott – Modelica Project Leader

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

Log in with your credentials

Forgot your details?