HWAT
In addition to the HyperMesh Tcl commands, the HyperWorks Automation Toolkit (HWAT) is provided. This toolkit provides a collection of functions and widgets that allows you to quickly assemble HyperWorks automations with minimal effort and maximum portability.
package require hwat;
This command indicates to Tcl that the HWAT package should be available inside the script. Once the package is loaded, the commands are available. All HWAT commands belong to the ::hwat namespace and must be called as such.
- Core Function: Primarily helper functions and are not used directly in most cases. They are usually called from within other functions.
- I/O Functions: Provide assistance for working with files.
- Math Functions: Provide for vector and matrix math calculations.
- Solver Functions: Provide automations for solver specific operations aimed at setting up crash models.
- Utility Functions: Functions for performing commonly required automations.
- Widget Functions: Tk functions to create widgets.
- XML Functions: Use a SAX-based parser and provide functionality for working with XML files.
Each of these function categories have a namespace associated with them, underneath the ::hwat namespace. For example, to call the I/O function CloseFile, the syntax used is ::hwat::io::CloseFile. Similar namespaces exist for the other categories.
proc GetAngle { vect1 vect2 } {
package require hwat;
set angle [::hwat::math::AngleBetweenVectors $vect1 $vect2];
tk_messageBox -message "The angle between the vectors is $angle";
}
GetAngle [list 1.0 2.0 3.0] [list 4.0 5.0 6.0]