Updating a Custom Library
You can edit the custom components and subsystems in your library in the model workspace, build new components for the library, and organize them into a hierarchy, which determines how they appear in the palette for the library in the Library Components tab (
) in MapleSim.
For more information about custom libraries, see Creating a Custom Library.
Save Updated Library
To update a subsystem or component in a custom library:
Open an existing MapleSim library file (File > Open). Alternatively, under the Library Components (
) tab in MapleSim, right-click (Control-click for Mac) on the custom library palette, and select Edit Library. The library opens in library edit mode.
In the model workspace, edit the subsystem or custom component (for example, you can edit the parameter values and add an image to the component icon). You can use the full functionality of MapleSim to test your components. For example, you can build a model in the library workspace and run diagnostics or simulate the model.
You can also create new components and subsystem or copy them from an existing MapleSim model.
The Local Components tab (
) on the left side of the MapleSim window displays the custom components and shared subsystems you have defined.
Note: If you create a subsystem and do not see it in the Local Components tab (
), you may not have converted it to a shared subsystem. Remember that a subsystem must be converted to a shared subsystem to be included in a library. For more information, see Converting a Subsystem into a Shared Subsystem.
The Local Components tab (
) on the left side of the MapleSim window consists of a search field and two palettes.
Components palette — Displays the shared subsystems and custom component definitions that you have created.
Hierarchy palette — Defines the organization of your custom library into groups and subgroups in the Library palette. Only components and subsystems in the hierarchy will appear in the custom library palette.
To organize components into a hierarchy in a custom library:
By default, the custom library's name is the hierarchy root name. This root group is the only required group in the hierarchy.
To add a subgroup, right-click (Control-click for Mac) on the root name in the Hierarchy palette and select Add New Subgroup.
Enter a name for the hierarchy subgroup. Repeat this process to create the tree for your library.
In the Components palette, right-click (Control-click for Mac) a subsystem or custom component definition and select Move to Hierarchy, and the desired location. Repeat this to move all the components and subsystems that you want to appear in the custom library palette into the hierarchy.
You can use the context-sensitive menus to rearrange or rename the groups of the hierarchy, move elements within the hierarchy, or remove elements from the hierarchy. When a component or subsystem is removed from the hierarchy, it is displayed in the Components palette.
You can also drag and drop elements to organize them in the hierarchy.
Groups within the hierarchy are always listed in alphabetical order.
The hierarchy is only an organizational tool. The location of an element in the custom library hierarchy has no effect on the underlying Modelica name. That is, if MyComponent is located in MyLibrary > a chain of subgroups > MyComponent, a Modelica reference to it is MyLibrary.MyComponent. Note this means that components in a custom library must have unique names.
The Search field above the palettes can be used to find a subsystem or custom component definition quickly. Both the Components palette and the Hierarchy are searched. Enter the full or partial name to find matching components.
Matches are not case-sensitive.
The Hierarchy tree is pruned to show only groups containing matching components.
To clear a search, click Clear Search (
Note: If you do not see all the expected components and subsystems in the Local Components tab (
), it may be because the filter from your last search is still active. Clear the current search to see all the components.
As you are working on your custom library, you may want to periodically save the file by clicking Save File (
). If you have the selective save feature enabled, you can use it to save only the changes you want to save. See The Selective Save Feature for more information on performing a selective save.
When you resave the custom library, the palette for the custom library displays the Needs Update icon (
), indicating it is out-of-date and needs to be reloaded.
To update the custom library palette with your changes:
Click Reload (
) in the Main Toolbar to save your changes and reload the palette for the custom library in the Library Components tab (
) with the updates. (Alternatively, from the Tools menu, select Reload Library.)
Reloading the library does not update the documentation for the custom components in the library.
To generate the documentation for the custom library and update the custom library palette with your changes:
From the Tools menu, select Create Library & Documentation.
If you have shared your library with others, they will also see this icon in their Library Components tab (
) and will need to reload the library to get the latest updates.
Creating a Custom Library
Adding Multiple Copies of Subsystems or Custom Components to a Model
Grouping Modeling Components into Subsystems
Managing Subsystems and Custom Components
The Selective Save Feature
Using Custom Libraries
Download Help Document
What kind of issue would you like to report? (Optional)