Run Command on Open for HyperView

User: "Blake Berk"
Altair Community Member
Updated by Blake Berk

Hi,

Looking for a way to run a command on open in HyperView, just like I can run hmcustom.tcl in HyperMesh to set some defaults and prep macros. Any ideas?

Thanks,

Blake

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "PaulAltair"
    Altair Employee
    Accepted Answer
    Updated by PaulAltair

    Hi Paul,

    The last thing you said is what I am interested in - creating a "permanent" button to run a macro. Do you know how to add that to the preference file? When I save a standard .mvw with the button added, it does not add it to the .mvw 'code.'

    Thanks for your time so far! Let me know if you have code to assist the creation of a button or tool bar addition.

    Best,

    Blake

    Ok, I created a generic annotated preferences file for you (attached) with a few of the alternatives for menus/buttons, depending on what your tcl 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 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

     

    It will mostly work straight away, but at this point, to make sure, 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, it is worth doing a close/open on HV/HG to check it too, and see what you get, if you break things don't worry, you can just 'load' the default settings back again and try something else.

    Good luck!

    if you have a play with this and can't get it doing what you want, get back to me!