Extension Manager#
Register and load user-defined extensions in the Extension Manager, found under the File menu at File > Extension Manager.
Sample extensions that illustrate the various use cases are included in the Extension Manager.
Extension Structure#
An extension is comprised of a folder containing a manifest file, plugin.xml, and all related scripts and resources.
The plugin.xml file defines the metadata of the extension such as name, version, and minimum supported product version. The entire content of plugin.xml should be wrapped inside of section as shown below:
<?xml version="1.0" encoding="UTF-8"?>
<section name="Extension">
<entry name="name" value="Boxify"/>
<entry name="script" value="extension.py"/>
<entry name="author" value="Altair Engineering Inc."/>
<entry name="publisher" value="Altair Engineering Inc."/>
<entry name="description" value="Boxifies a selected part in Inspire."/>
<entry name="documentation" value="readme.html"/>
<entry name="minProductVersion" value="2021.2"/>
</section>
Attribute |
Description |
---|---|
name |
Name of the Extension |
minProductVersion |
The minimum version of the product that is supported by this extension |
description |
A short description about this extension that is displayed in the Extension Manager user interface |
documentation |
HTML file with the detailed description of the extension that can be opened in a web browser through the Extension Manager user interface |
author |
The author of this extension |
publisher |
The publisher of this extension |
script |
The script that should be executed when this extension is loaded |
resources |
Location of the resources directory relative to the extension directory |
settings |
An xml file that defines the settings of this extension |
advancedToolTip |
An xml file that defines the tooltips related to this extension |
workFlowHelp |
An xml file that defines the workflow help content of this extension |
required |
The plugin that should be loaded as a pre-requisite for this extension |
extends |
The plugin that this plugin should be auto-loaded after |
profile |
The name of the profile implemented in this extension |
Implementing a Profile as an Extension#
A Profile is the UI state that defines menus, ribbon pages, toolbars and dock windows. There can be multiple Profiles, but only one can be active, or displayed, at a time. Splitting functionality into Profiles can reduce screen clutter, allowing the user to focus on specific tasks.
Profiles can be hierarchical with a Profile having sub-Profiles. Sub-Profiles can make use of the base Profile functionality and implement additional functionality as required. There are two types of Profiles, stand-alone and add-on.
A stand-alone Profile re-configures the entire UI.
An add-on Profile contributes added functionality to an existing Profile.
The plugin.xml should have an entry defining the Profile name so that the Framework loads this extension when the Profile is requested to be activated.
<entry name="profile" value="MyProfile"/>
The following command line should be used to load the Profile, where -p
denotes the extension and -pr
denotes the Profile:
<installation directory>/hwx/bin/win64/runhwx.exe -p MyExtension -pr MyProfile
Sample code snippet for Profile Creation#
from hwx import gui
class MyProfile(gui.Profile):
def build(self):
gui.RibbonPage(name="Geometry", children=[
gui.RibbonPageGroup(name="Modify", children=[
gui.SpriteActionGroup (
text = "Boolean",
children = [gui.SpriteAction (text = "Test", icon = "ribbonBooleanMainStrip-80.png", command = lambda: print('you clicked a button!!!'))])])])
def activate(self):
print('activate')
#Profile creation
profile = MyProfile("MyProfile")
Managing Extensions#
Add an Extension#
Click File > Extension Manager to open the Extension Manager.
Click Add Extension, and browse to the extension folder to register it.
- Note:
All of the extensions located in the Custom plugins location specified in Preferences are automatically registered by the Extension Manager. The default custom plugins location is <USERPROFILE>/Documents/Altair/extensions.
Toggle Load to load the extension in Inspire.
Result: The extension is loaded in Inspire. This extension creates a new icon on a new ribbon.
Unload an Extension#
Click File > Extension Manager to open the Extension Manager.
Toggle Unload to unload an extension but preserve it in the Extension Manager and keep its registration.
Remove an Extension#
Click File > Extension Manager to open the Extension Manager.
Click Remove to unregister an extension and remove it from the Extension Manager.
- Note:
If you unregister an extension that is in the custom plugins folder, click Add Extension to manually re-register it.