Innovation Intelligence ® 1 Chapter 4: Using TCL to Control the HyperMesh Session.

Slides:



Advertisements
Similar presentations
CC SQL Utilities.
Advertisements

© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 2Managing and Integrating Data and the Excel Environment Chapter 7Automating Repetitive Tasks.
 Statistics package  Graphics package  Programming language  Can be used to share/reproduce analyses  Many new packages being created - can be downloaded.
 2005 Pearson Education, Inc. All rights reserved Introduction.
Finite Element Method FEM Dr. Mohammed Al-Hazmi ANSYS Basics Lecture 4.
Automating Tasks With Macros
Creating Web Page Forms. Objectives Describe how Web forms can interact with a server-based program Insert a form into a Web page Create and format a.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
Innovation Intelligence ® 1 Chapter 3: HyperMesh Automation with HyperMesh Macros.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Innovation Intelligence ® 1 Chapter 6: Interfacing with HyperMesh Solver Templates.
State of Connecticut Core-CT Project Query 4 hrs Updated 1/21/2011.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
TIBCO Designer TIBCO BusinessWorks is a scalable, extensible, and easy to use integration platform that allows you to develop, deploy, and run integration.
Chapter 9 Macros, Navigation Forms, PivotTables, and PivotCharts
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
A First Program Using C#
Visual Basic Chapter 1 Mr. Wangler.
XP Tutorial 6New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Creating Web Page Forms Designing a Product Registration Form Tutorial.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
Innovation Intelligence ® 1 Chapter 1: Introduction to TCL.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 4 – Creating New.
What is Sure BDCs? BDC stands for Batch Data Communication and is also known as Batch Input. It is a technique for mass input of data into SAP by simulating.
Innovation Intelligence ® SimLab Automation Training Nirmal Subbaiah May, 2013.
Innovation Intelligence ® 1 Chapter 5: Retrieving Data from HyperMesh Entities.
Creating a Web Site to Gather Data and Conduct Research.
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Innovation Intelligence ® 1 Chapter 7: The MotionView Client.
Piotr Wolski Introduction to R. Topics What is R? Sample session How to install R? Minimum you have to know to work in R Data objects in R and how to.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
Automating Database Processing
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
Chapter 17 Creating a Database.
ITCS373: Internet Technology Lecture 5: More HTML.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
Microsoft Access 2010 Chapter 10 Administering a Database System.
XP Chapter 2 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Building The Database Chapter 2 “It is only the farmer.
Innovation Intelligence ® 1 Chapter 6: The Plotting Client.
Chapter 2: Introduction to HyperMesh Process Auomation
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Innovation Intelligence ® Section 15 Contact Modeling.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
Porting a large scale enterprise application from Tcl/Tk 8.4 to 8.5 Prashant Thakre, Tushar Gupta {prashant_thakre, Gaurav Bansal.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Aliya Farheen October 29,2015.
Lesson 4.  After a table has been created, you may need to modify it. You can make many changes to a table—or other database object—using its property.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
30 Copyright © 2009, Oracle. All rights reserved. Using Oracle Business Intelligence Delivers.
NMD202 Web Scripting Week2. Web site
Innovation Intelligence ® 1 Chapter 4: The Animation Client.
Innovation Intelligence ® Section 20 Flux and Convection.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Innovation Intelligence ® RBE3 Reduction Macro Dennis D. Schwerzler March 27, 2012.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
1 Copyright © 2008, Oracle. All rights reserved. Repository Basics.
Innovation Intelligence ® 1 Chapter 2: The HyperWorks Desktop Environment.
Excel Tutorial 8 Developing an Excel Application
SQL and SQL*Plus Interaction
Appendix B MathScript Basics
Current outstanding balance
MATLAB: Structures and File I/O
MODULE 7 Microsoft Access 2010
Using SQL*Plus.
Presentation transcript:

Innovation Intelligence ® 1 Chapter 4: Using TCL to Control the HyperMesh Session

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 2 Using Tcl to Control the HyperMesh Session - Overview Topics Presented: HyperMesh commands vs. Tcl Modify Commands Tcl GUI Commands and Tcl Query Commands Basic HyperMesh Input Widgets Common HyperMesh Tcl Commands Using the Command Window Example: Using the Command Window Process to Create a Tcl HyperMesh macro Example: Automate Creating Forces with a User Specified Magnitude

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 3 Using Tcl to Control the HyperMesh Session - Overview The macros that have been created thus far are very powerful in their automation of repetitive tasks. However, there are limitations. The Tcl scripting language can be utilized to provide support for more advanced tasks. Using the previous example, Tcl could be used to request a name for the load collector from the user and use that information to tell the HyperMesh session to create a load collector with the user provided name.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 4 The HyperMesh commands which were presented in the previous chapter are also available through their Tcl Modify commands Notice that while the parentheses and commas have been removed, each of the commands still begin with an asterisk (*) and that the command name hasn’t changed. In addition to the syntax change, Tcl core commands can also be used. HyperMesh commands vs. Tcl Modify Commands Macro in userpage.mac fileTcl Script *beginmacro("macroJpeg")Not used in Tcl *setbackgroundcolor(255,255,255) *setbackgroundcolor *setmeshlinecolor(6)*setmeshlinecolor 6 *jpegfile()*jpegfile *setbackgroundcolor(0,0,0)*setbackgroundcolor *setmeshlinecolor(0)*setmeshlinecolor 0 *endmacro()Not used in Tcl

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 5 Tcl GUI Commands and Tcl Query Commands HyperMesh Tcl GUI commands make changes/updates in the HyperMesh GUI HyperMesh Tcl Query Commands query the HyperMesh database for information. These commands have the prefix “hm_”. We will go over two basic HyperMesh input widgets and a table of common commands.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 6 Basic HyperMesh Input Widgets hm_getstring passes a string value entered by the user: hm_getstring ?option? ?message? hm_getstring “Load collector name” “Enter a name for the load collector” This command can be used with the set Tcl command to assign the string entered in the panel to a variable: set loadname [hm_getstring “Load collector name” “Enter name for load collector”]

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 7 Basic HyperMesh Input Widgets hm_getint and hm_getfloat passes values entered by the user. hm_getint returns a user input integer value. hm_getfloat returns a user input floating point value. Both these commands have the same options as the hm_getstring command. set force [hm_getfloat “Force” “Enter force value”]

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 8 Common HyperMesh Tcl Commands hm_answernext Force an answer to the next *command hm_answernext "yes" *deletemodel hm_blockmessages Inform HyperMesh whether or not messages should be displayed in header message bar hm_elemlist Return list of element ids for passed component id hm_entityinfo Get information about entities in current model hm_entitylist Get list of names or IDs of all entities of the requested type in current model hm_entitymaxid Return maximum ID in use for an entity type hm_errormessage Display error message in header message bar hm_getclosestnode Return ID of closest node to point x y z hm_getentityvalue Get information for an entity using the HyperMesh template interface hm_getfilename Get filename from user using HyperMesh file panel hm_getfloat Get floating point value from user using HyperMesh panel hm_getint Get integer value from user using HyperMesh panel hm_getmark Get ids for passed entity type on passed mark mask hm_getstring Get text string from user using HyperMesh panel hm_info Get general information about HyperMesh hm_markclear Clear IDs for entity type from passed mark mask hm_nodelistGet list of node IDs for passed element hm_nodevalueGet XYZ values for passed node ID hm_usermessage Display message in HyperMesh header message bar

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 9 Using the Command Window An interactive Command Window is provided and can be access through the View menu. This launches the Tk Console (TkCon) which is an interactive console which comes with Tk. In the Command Window, users can evaluate any command that can be issued in Tcl or in HyperMesh through Tcl. Such as ls, pwd, and cd can be used within the Command Window.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 10 Using the Command Window General Tcl and HyperMesh specific Tcl commands can also be entered. For example, let’s use the HyperMesh specific Tcl command hm_info with the following options: hm_info –appinfo SPECIFIEDPATH TEMPLATES_DIR This returns the current template directory. Using the Command Window provides the automation tool developer an easy means of testing a concept before writing the full procedure. In the Command Window you can… Evaluate any command that can be issued to Tcl or to HyperMesh through Tcl Run scripts using the source command, i.e. source test.tcl, or, run scripts using the File >> Load menu option Save the session’s command history using the File >> Save menu option

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 11 Example: Using the Command Window The purpose of this example is to become familiar with using the Command Window for developing in Tcl. HyperMesh Tcl and core Tcl commands will be used in the Command Window to determine the number of elements in a component collector for a pre-defined HyperMesh model. The following commands are used in this exercise: Modified HyperMesh commands: *createmark() HyperMesh Tcl commands hm_info hm_getmark Core Tcl commands list llength set source

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 12 Process to Create a Tcl HyperMesh macro This process is nearly identical to developing a HyperMesh Basic macro except: The HyperMesh commands must be converted to Tcl format Tcl core commands are allowed to introduce control logic to the automation tools. 1.Define the task. 2.Delete the existing command.cmf file. This file is located in either the start-in directory or the current working directory. 3.Perform the operations in HyperMesh that the script should run. 4.Extract the commands from the command.cmf. 5.Create a Tcl script by converting the commands to Tcl format and modifying as necessary (this includes adding additional Tcl commands) 6.Create a new Utility menu macro that runs a Tcl script. 7.Add macro button using *createbutton that calls the macro created in Step 6 with the appropriate Tcl script filename. 8.Reload the current.mac file into HyperMesh to load the modified userpage.mac. 9.Test the macro.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 13 Example: Automate Creating Forces with a User Specified Magnitude In this example, we will go through the general process for creating HyperMesh Tcl scripts. The script will automate the creating of forces with a user defined magnitude. The following commands are used in this example: Modified and added HyperMesh commands: *createmark *clearmark HyperMesh Tcl commands: hm_getfloat Core Tcl commands: set

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 14 Practical Exercises Exercise 4a Description Create a HyperMesh Tcl script to automate the following task Create a component collector with a user specified name Select elements and move those elements into the new component collector. Translate the elements in the new component collector a user specified distance in the z direction. HyperMesh commands used hm_getstring *collectorcreateonly *createmarkpanel*movemark *clearmark*createvector hm_getfloat*translatemark TCL/TK commands used set Hints Be sure to do the steps in HyperMesh and then extract the appropriate commands from the command.cmf file. Modify the commands as necessary and be sure to clear the mark when needed.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 15 Practical Exercises Exercise 4b Description For each element in a HyperMesh model, build a list where the contents of the list are as follows ELEMID {NODE1 NODE2 …} These lists should then be included in a list of lists: {{ELEMID1 {NODE1 NODE2 …} {ELEMID2 {NODE1 NODE2 …} … HyperMesh commands used *createmarkhm_getmark hm_nodelist TCL/TK commands used forforeachlist lappendsetincr ifelseifelse Hints The majority of this assignment will be discovering where to find information about commands and how to apply the information you find. Be patient and use the resources available to you, including the HyperWorks online help.