hm_framework
Controls certain options and of the HyperMesh GUI framework.
Syntax
hm_framework argument ?options?
Type
HyperMesh Tcl GUI Command
Description
This command allows you to update and query many aspects of the HyperMesh GUI framework. Depending on the argument specified, the supported options will change.
Inputs
- activatetab name
- Activates (raises) the tab named name.
- addtab name ?frame_name? ?width_proc? ?notify_proc? ?is_global?
- Add a new tab named name.
- formatwindowtitle string
- Returns string formatted for the window title. This is used by user profiles to show a standard layout. It is used in conjunction with hm_wm title.
- getactivetabs
- Returns a list of active (raised) tabs. This only returns standard HyperMesh tabs, not tabs created using hm_framework addtab.
- getalltabs
- Returns a list of all tabs. This returns both standard HyperMesh tabs and tabs created using hm_framework addtab.
- getcmdstatus
- Returns the current visible status (0=off, 1=on) of the command window.
- getgraphicsclick
- After running with this option, a message is posted to "Move the mouse into the graphics region." You can move the mouse anywhere with no effects, as long as they never enter the modeling window. Once the mouse is moved inside the modeling window, a message to click on the screen is posted. At this point, if you move anywhere outside of the modeling window at all, the mode is exited and an empty string is returned. Right-clicking also forces an exit and returns an empty string. The first left click in the modeling window returns the x, y coordinates (relative to the entire screen) and exits the mode. If multiple monitors are used, the coordinates are returned relative to monitor 1. The return values are consistent with hm_winfo graphicx/graphicy options.
- gethmtabs
- Returns a list of the standard HyperMesh tabs.
- getregisteredprocs event
-
- before_exit
- database_modified
- gettabframe name
- Returns the frame associated with the tab named name.
- getuserprofile
- Returns the current user profile and user subprofile names. If no user profile is loaded, both values will return null. If there is no subprofile for the current profile, subprofile will be null.
- getvisibletabs
- Returns a list of visible tabs. This returns both standard HyperMesh tabs and tabs created using the addtab option. This returns both visible tabs and tabs that exist but have their tab area turned off.
- loaduserprofile profile subprofile after_proc
- Loads a user profile with name profile.
- registerproc notify_proc event
- The procedure notify_proc will be added to a list of procedures to be
called when event occurs. Current supported events are:
- activate_gui - Calls notify_proc with no arguments when HyperMesh client is activated.
- after_userprofile - Calls notify_proc with one argument (the name of the user profile that was loaded).
- before_exit - Calls notify_proc with no arguments. It is recommended that you add a dialog or a prompt in notify_proc, prompting you if you want to exit or not. A return value of 1 from notify_proc will not exit HyperMesh. Any other value will exit HyperMesh.
- database_modified - Calls notify_proc with no arguments when any operation is performed that modifies the database. This has the potential for performance deprecation as the procedure is called for every database modification.
- deactivate_gui - Calls notify_proc with no arguments when HyperMesh client is deactivated.
- graphics_selection_changes - Calls notify_proc with no arguments when any entity is selected or unselected in the modeling window.
- removetab name
- Remove tab named name. The associated frame still remains unless it is specifically destroyed. This command can be used with standard HM tabs as well as tabs created using hm_framework addtab.
- unregisterproc proc_name event
- The procedure notify_proc will be removed from the list of procedures
to be called when event occurs. Current supported events are:
- after_userprofile
- before_exit
- database_modified
Examples
hm_createmark elems 1 advanced all;
set count [hm_marklength elems 1];
hm_markclear elems 1;
set f .summary
frame $f
hm_framework addpanel $f "Model Info";
hm_framework drawpanel $f;
set top [frame $f.top];
pack $top -side top;
set bottom [frame $f.bottom];
pack $bottom -side bottom -fill x -expand 0;
label $top.label -text "Count of elements in model: $count";
pack $top.label
set alltabs [hm_framework getalltabs]
if {[lsearch $alltabs $title] != -1} {
hm_framework activatetab "$title"
} else {
set recess [frame .g_Model_Info -padx 7 -pady 7];
hm_framework addtab "Model Info" $recess
}
Errors
if { [ catch {command_name...} ] } {
# Handle error
}
Version History
2020.1 - getuserprofile and loaduserprofile are now supported in batch mode.
2021 - popgui, pushgui, removelabelsfrompulldowns, removepanelsfrompulldowns, resetpulldowns, setguigeom, and setnativeheight are deprecated in HyperWorks but continue to be supported in HyperWorks Desktop.
2021.2 - resizetab is deprecated in HyperWorks but continues to be supported in HyperWorks Desktop. addframe and removeframe options have been removed.
2022 - getpulldowns is deprecated in HyperWorks but continues to be supported in HyperWorks Desktop.
2022 - Deprecated options addpanel, drawpanel, getrecentfiles, and getrecentimports. Removed options addrecentfile, addrecentimport, getmenustatus, getpulldowns, getregisteredprocs after_menudraw, getregisteredprocs before_menudraw, getregisteredprocs erase_userpanel, popgui, pushgui, registerproc after_menudraw, registerproc before_menudraw, registerproc erase_userpanel, removelabelsfrompulldowns, removerecentfile, removerecentimport, resetpulldowns, resizetab, setcmdstatus, setguigeom, setnativeheight, unregisterproc after_menudraw, unregisterproc before_menudraw, and unregisterproc erase_userpanel.