01 - Chapter 2 HyperMesh Process Automation Intro - 10template
01 - Chapter 2 HyperMesh Process Automation Intro - 10template
Topics Presented:
• Some benefits
• Reduces user time and mouse clicks for lengthy and repetitive tasks.
• Creates custom HyperMesh environments
• Application examples
• One click shortcut to automesh panel, cleanup sub-panel, add point: point
button
• One click tool turning on/off all of the geometry
• One click tool creating a component collector with a hard-coded name
• Limitations
• Cannot cancel execution or reject results of a macro
• A macro is not recursive; it cannot call itself
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
• Tcl/Tk
• Publicly available, open-standard, interpreted scripting language
• Some benefits
• Add logic and conditional control to HyperMesh macros
• Develop custom applications, including user-defined panels
• Application examples
• Tool creating a solver material database
• Tool defining a HyperMesh panel
• Tool requesting user to specify load collector name and then creates the
collector with that name if one does not already exist
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
• Some benefits
• Standardize CAE processes
• Minimize CAE analysis set-up time
• Rerun previously-conducted CAE processes
• Provide integration with CAD, PDM systems, databases, intranets, and job
submission systems
• Streamline CAE activities
• Establish and distribute “Best Practice” processes corporate wide
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
• It is customizable
• Add to it buttons with associated, user-created macros and Tcl/Tk
scripts
• The default hm.mac file sources the following additional macro files:
• disppage.mac Populates the Display page of the Utility Menu
• geommeshpage.mac Populates the Geom/Mesh page of the Utility
Menu
• globalpage.mac Creates the button group that allows you to switch pages
• qamodelpage.mac Populates the QA/Model page of the Utility Menu
• userpage.mac Populates the User page of the Utility Menu
*createbutton() Syntax:
*beginmacro(“createForce_macro”)
*evaltclscript($1,0)
*endmacro()
• *evaltclscript(filename, flag)
• Filename Tcl/Tk filename to run
• Flag flag to run command end functions, default = 0
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
Online Help
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
Practical Exercises
Exercise 2a
Description
Add a button to the User Page on the Utility Menu which executes the
macro modeltour.tcl. This macro is located in the installation under hm\
scripts, so a path is not needed. The name of the button should be
“Model Tour”. The help string should be “Explore HyperMesh Session”.
The color and location are up to you.
HyperMesh commands used
*createbutton()
TCL/TK commands used
none
Hints
On Windows, the working directory is located in the My Documents
folder. Create a new text file called userpage.mac in this location and
add the appropriate commands to make the button evaluate the tcl file.