How to use a custom preferences mvw to add shortcut menus to macros/scripts in HV/HG

PaulAltair
PaulAltair
Altair Employee
edited May 28 in Altair HyperWorks

If you have user macros or tcl scripts and you want to be able to access them in HyperView or HyperGraph without having to use File --> Run every time, then a custom preferences mvw might be for you.

I created a simple generic annotated preferences file (attached) with a few of the alternatives for menus/buttons, depending on what your tcl or macro is doing, one of these may be more appropriate than the others, you ought to be able to hack it to do what you want (edit the tcl references, remove anything you don't need), it includes menu options for both hyperview and hypergraph, It is also possible to make submenus etc if needed, this is just a simple example.

To use it, download it, put it somewhere sensible (e.g. create an 'AltairPrefs' Folder somewhere)

Then in hyperview/graph, go to load --> Preference File

image

 

Click 'Register' and browse to the mvw you saved, and 'open' it

image

 

It should then appear in the list of preferences, you can pick it and click 'Load', this should be 'sticky' i.e. the selected prefs file is loaded by default on every HV/HG launch.

image

 

At this point, to make sure it is being fully loaded in, it is worth closing/reopening HV/HG

 

In HyperView Client, you should now have a menu dropdown called 'MyMacro' with a single entry (points to a tool built into the installation)

image

 

And in HyperGraph Client a similar dropdown, this time with 2 entries, one for the same tool, one for a shortcut to a filter macro

image

 

also in Hypergraph, there should be 2 other menus

A 'My Macro' Menu on right clicking a curve in the browser (performs tasks on that curve)

image

 

 

And a 'My Macro' Menu on right clicking a curve in the graphics area (performs tasks on that curve)

image

 

 

You can edit this, unregister/register it, load it, as many times as you need to in order to test your setup, it is worth doing a close/open on HV/HG after a load to check it too (sometimes dropdowns are not immediately visible or you may get double entries in context menus within a session, these should be cleared up on a close/open), and see what you get, if you break things don't worry, you can just 'load' the 'default' settings back again from the preferences menu and try something else.

Good luck!

Paul