How to set up a shortcut key for a menu bar command?

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Hi!

I already know how to set up a shortcut in Hypermesh and how to mapping a push panel command. Just like set the qualityindex command is 'hm_pushpanel {qualityindex}'.

So my question is how to mapping a menu bar command to a key, such as ' Tools--Model Checker--Abaqus'.

 

Thanks & Regards

 

Tagged:

Answers

  • tinh
    tinh Altair Community Member
    edited July 2016

    Maybe, need a proc like this:

     proc ::hm_callmenu args {    set mnuMain [lindex $args 0]    if {![winfo exists $mnuMain]} {set mnuMain [. cget -menu]} else {set args [lrange $args 1 end]}    set mnuTarget $mnuMain    set mnuItem [lindex $args end]    set args [lrange $args 0 end-1]    for {set i 0} {$i<[llength $args]} {incr i} {       set mnuSub [string tolower [lindex $args $i]]       set mnuSub [string map {' ' _} $mnuSub]       set mnuTarget $mnuTarget.$mnuSub    }    if {[winfo exists $mnuTarget]} {        $mnuTarget invoke $mnuItem    } else {        tk_messageBox -title Hypermesh -message 'Menu not found ' $mnuTarget '' -icon error    } }

     

    now assign to shortcut key to call a menu:

     hm_callmenu Tools {Model Checker} Abaqus

     

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited February 2020

    How to setup the 'save' shortcut key in hypermesh software