Altair Engineering Contact Information
Web site www.altairhyperworks.com
FTP site
Address:
Login:
Password:
ftp.altair.com or ftp2.altair.com or http://ftp.altair.com/ftp
ftp
<your e-mail address>
Location Telephone e-mail
Australia 61.3.9016.9042 anzsupport@altair.com
Brazil 55.11.3884.0414 br_support@altair.com
China 86.21.6117.1666 support@altair.com.cn
France 33.1.4133.0992 francesupport@altair.com
Germany 49.7031.6208.22 hwsupport@altair.de
India
91.80. 6629.4500
1.800.425.0234 (toll free)
support@india.altair.com
Italy 39.800.905.595 support@altairengineering.it
Japan 81.3.5396.2881 support@altairjp.co.jp
Korea 82.31.716.4321 support@altair.co.kr
New Zealand 64.9.413.7981 anzsupport@altair.com
North America 248.614.2425 hwsupport@altair.com
Scandinavia 46.46.286.2052 support@altair.se
United Kingdom 01926.468.600 support@uk.altair.com
The following countries have distributors for Altair Engineering:
Asia Pacific: Indonesia, Malaysia, Singapore, Taiwan, Thailand
Europe: Czech Republic, Hungary, Poland, Romania, Spain, Turkey.
Copyright© Altair Engineering Inc. All Rights Reserved for:
HyperMesh® 1990-2013; HyperCrash® 2001-2013; OptiStruct® 1996-2013; RADIOSS®1986-2013; HyperView®1999-2013;
HyperView Player® 2001-2013; HyperStudy® 1999-2013; HyperGraph®1995-2013; MotionView® 1993-2013; MotionSolve® 2002-
2013; HyperForm® 1998-2013; HyperXtrude® 1999-2013; Process Manager™ 2003-2013; Templex™ 1990-2013; MediaView™
1999-2013; BatchMesher™ 2003-2013; TextView™ 1996-2013; HyperMath® 2007-2013; ScriptView™ 2007-2013; Manufacturing
Solutions™ 2005-2013; HyperWeld® 2009-2013; HyperMold® 2009-2013; solidThinking® 1993-2013; solidThinking Inspire™
2009-2013; solidThinking Evolve™ 1993-2013; Durability Director™ 2009-2013; Suspension Director™ 2009-2013; AcuSolve®
1997-2013; and AcuConsole® 2006-2013.
In addition to HyperWorks® trademarks noted above, GridWorks™, PBS GridWorks®, PBS Professional®, PBS™, PBS Works™
and Portable Batch System® are trademarks of ALTAIR ENGINEERING INC. All are protected under U.S. and international laws
and treaties. Copyright© 1994-2013.
Additionally, the Altair software is protected under patent #6,859,792 and other patents pending.
All other marks are the property of their respective owners.
ALTAIR ENGINEERING INC. Proprietary and Confidential. Contains Trade Secret Information. Not for use or disclosure outside of
ALTAIR and its licensed clients. Information contained in HyperWorks® shall not be decompiled, disassembled, or “unlocked”,
reverse translated, reverse engineered, or publicly displayed or publicly performed in any manner. Usage of the software is only as
explicitly permitted in the end user software license agreement.
Copyright notice does not imply publication.
HyperWorks 12.0 Introduction to HM Customization 3
Proprietary Information of Altair Engineering, Inc
Table of Contents
Introduction to HyperMesh
Customization
Chapter 1: Introduction to TCL ......................................................................... 5
About TCL .................................................................................................................................. 5
About Tk ..................................................................................................................................... 6
Basic Tcl Syntax ........................................................................................................................ 6
TCL Command Overview ......................................................................................................... 6
Tk Basic Commands ............................................................................................................... 21
Chapter 2: HyperMesh Process Automation Introduction ........................... 27
What is a HyperMesh Macro ................................................................................................. 27
The HyperMesh Utility Menu ................................................................................................. 28
Practical Exercises .................................................................................................................. 33
Chapter 3: HyperMesh Automation with HyperMesh Macros ....................... 35
HyperMesh Commands ............................................................................................... 35
HyperMesh Macro Structure ........................................................................................ 39
Process to Create HyperMesh Macros ........................................................................ 40
Introduction to HM Customization 4 HyperWorks 12.0
Proprietary Information of Altair Engineering, Inc
Modifying Commands to Create Generalized Macros ................................................. 44
Practical Exercises ....................................................................................................... 46
Chapter 4: Using Tcl to Control the HyperMesh Session ............................ 47
HyperMesh Commands vs. Tcl Modify Commands ..................................................... 47
Tcl GUI Commands and Tcl Query Commands .......................................................... 48
Using the Command Window ...................................................................................... 50
Process to Create a Tcl HyperMesh Macro ................................................................. 55
Practical Exercises ....................................................................................................... 60
Chapter 5: Retrieving Data from HyperMesh Entities .................................. 63
HyperMesh Entities and Their Data Names ................................................................. 63
Pointers and Flags ....................................................................................................... 65
Process for Creating a HyperMesh Tcl Script to Retrieve Data
on HyperMesh Entities ...................................................................................... 67
Practical Exercises ....................................................................................................... 71
Chapter 6: Interfacing with HyperMesh Solver Templates .......................... 75
Solver Attributes and Card Images .............................................................................. 76
Querying Solver Attributes ........................................................................................... 77
Assigning Data to Solver Attributes ............................................................................. 81
Creating a Reusable and Modular Procedure .............................................................. 82
Updating Solver Attributes ........................................................................................... 88
Practical Exercises ....................................................................................................... 91
Solutions For Exercises ................................................................................... 93
Chapter 1: Introduction to Tcl/Tk
HyperWorks 12.0 Introduction to HM Customization 5
Proprietary Information of Altair Engineering, Inc
Chapter 1
Introduction to Tcl/Tk
About TCL
Tcl (Tool Command Language) is used by developers worldwide and has become a
critical component in thousands of corporations. It has a simple and programmable
syntax and can be either used as a standalone application or embedded in application
programs. Best of all, Tcl is open source so it's completely free.
The main difference between Tcl and languages such as C is that Tcl is an interpreted
rather than a compiled language. Tcl programs are simply scripts consisting of Tcl
commands that are processed by a Tcl interpreter at run time. One advantage that this
offers is that Tcl programs can themselves generate Tcl scripts that can be evaluated at
a later time. This can be useful, for example, when creating a graphical user interface
with a command button that needs to perform different actions at different times.
One of Tcl's most useful features is its extensibility. If an application requires some
functionality not offered by standard Tcl, new Tcl commands can be implemented using
the C language, and integrated fairly easily. Since Tcl is so easy to extend, many people
have written extension packages for some common tasks, and made these freely
available on the Internet.
Businesses and engineering teams today are often faced with the problem of making
diverse collections of resources work together. We call these programming tasks
integration applications. For enterprises, the integration platform is becoming as
strategically important as the operating system and database platforms.
Tcl is the integration platform of choice because of its speed of use, breadth of
functionality, and enterprise-ready features such as thread-safety, internationalization
and cross platform deployment. The latest version of Tcl provides all the features an
enterprise needs for all integration and scripting needs.