How to set up a shortcut key for a menu bar command?
Altair Forum User
Altair Employee
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
1
Answers
-
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
0 -
How to setup the 'save' shortcut key in hypermesh software
0