Innovation Intelligence ® 1 Chapter 3: HyperMesh Automation with HyperMesh Macros.

Slides:



Advertisements
Similar presentations
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. Introduction in Altair ® HyperMesh ® The Fastest, Solver Neutral.
Advertisements

Basics Of Spreadsheets Chapter Spreadsheet spreadsheet: grid of cells, each of which can contain text data or numeric data.
Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.  CAD import  Geometry cleanup / repair  Prepare geometry.
Developing an Excel Application
Tutorial 8: Developing an Excel Application
Tutorial 12: Enhancing Excel with Visual Basic for Applications
 Copyright I/O International, 2013 Visit us at: A Feature Within from Vendor Payment Terms User Friendly Maintenance 
The Web Warrior Guide to Web Design Technologies
Word Lesson 7 Working with Documents
Exploring Microsoft Access 2003 Chapter 7 Building Applications: The Switchboard, Macros, and Prototyping.
Exploring Microsoft Access 2003 Chapter 1 Introduction to Microsoft Access: What Is A Database?
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.
 2003 Prentice Hall, Inc. All rights reserved. 1 Arrays –Structures of related data items –Static entity (same size throughout program) A few types –Pointer-based.
Using Templates Object-Oriented Programming Using C++ Second Edition 11.
1 Committed to Shaping the Next Generation of IT Experts. Chapter 3 – Graphs and Charts: Delivering a Message Robert Grauer and Maryann Barber Exploring.
Innovation Intelligence ® 1 Chapter 6: Interfacing with HyperMesh Solver Templates.
Exploring Microsoft Excel 2002 Chapter 8 Chapter 8 Automating Repetitive Tasks: Macros and Visual Basic for Applications By Robert T. Grauer Maryann Barber.
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.
XP New Perspectives on XML Tutorial 3 1 DTD Tutorial – Carey ISBN
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
EnSight analyze, visualize, communicate EnSight 6.x Advanced Training Part 1 Instructors: Mike Krogh, Anders Grimsrud.
IE 212: Computational Methods for Industrial Engineering
Copyright 2007, Paradigm Publishing Inc. EXCEL 2007 Chapter 7 BACKNEXTEND 7-1 LINKS TO OBJECTIVES Record & run a macro Record & run a macro Save as a macro-
Chapter 3 Mastering Editors
JavaScript, Fourth Edition
Innovation Intelligence ® SimLab Automation Training Nirmal Subbaiah May, 2013.
Innovation Intelligence ® 1 Chapter 5: Retrieving Data from HyperMesh Entities.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
ANSYS Fundamentals This document contains no technical data subject to the EAR or the ITAR.
CHAPTER 13 Creating a Workbook Part 2. Learning Objectives Work with cells and ranges Work with formulas and functions Preview and print a workbook 2.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 6 Value- Returning Functions and Modules.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Word 2007 Chapter 4: Share, Compare and Document Robert Grauer, Keith.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Exploring Microsoft Access 97 Chapter 1 Introduction to Microsoft Access: What Is A Database? Office graphic copyright by Microsoft Corp.
Innovation Intelligence ® 1 Chapter 7: The MotionView Client.
Linux+ Guide to Linux Certification, Third Edition
Innovation Intelligence ® Section 1 User Interface and Layout.
Oracle Data Integrator Procedures, Advanced Workflows.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
Tutorial 8 Designing a Web Site with Frames. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore the uses of frames.
1 ADVANCED MICROSOFT WORD Lesson 14 – Editing in Workgroups Microsoft Office 2003: Advanced.
Editors And Debugging Systems Other System Software Text Editors Interactive Debugging Systems UNIT 5 S.Sharmili Priyadarsini.
Chapter 1 – Matlab Overview EGR1302. Desktop Command window Current Directory window Command History window Tabs to toggle between Current Directory &
Innovation Intelligence ® 1 Chapter 6: The Plotting Client.
Chapter 9 Macros And Visual Basic For Applications.
1 PL\SQL Dev Templates. 2 TEMPLATE DEFINITION Whenever you create a new program unit, its initial contents are based upon a template which contains pre-defined.
Chapter 2: Introduction to HyperMesh Process Auomation
Copyright © 2010 Altair Engineering, Inc. All rights reserved.Altair Proprietary and Confidential Information Section 20 Flux and Convection.
Chapter Three The UNIX Editors.
Innovation Intelligence ® Section 15 Contact Modeling.
Exploring Microsoft Access Chapter 7 Building Applications: The Switchboard, Macros, and Prototyping.
Shell Scripting – Putting it All Together. Agenda Escaping Characters Wildcards Redirecting Output Chaining and Conditional Chaining Unnamed and Named.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
Chapter 131 Applets and HTML Chapter Objectives learn how to write applets learn to write a simple HTML document learn how to embed an applet in.
Innovation Intelligence ® 1 Chapter 4: Using TCL to Control the HyperMesh Session.
Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Word 2007 Chapter 4: Share, Compare and Document Robert Grauer, Keith.
30 Copyright © 2009, Oracle. All rights reserved. Using Oracle Business Intelligence Delivers.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
Innovation Intelligence ® 1 Chapter 4: The Animation Client.
Innovation Intelligence ® Section 20 Flux and Convection.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
Innovation Intelligence ® 1 Chapter 2: The HyperWorks Desktop Environment.
Excel Tutorial 8 Developing an Excel Application
Guide To UNIX Using Linux Third Edition
Windows Internet Explorer 7-Illustrated Essentials
Exploring Microsoft Excel
Presentation transcript:

Innovation Intelligence ® 1 Chapter 3: HyperMesh Automation with HyperMesh Macros

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 2 Overview Topics Presented: HyperMesh Commands Command Files Entity Types, Marks, Planes and Vectors Common Command File Commands HyperMesh Macro Structure Process to Create HyperMesh Macros Example: Automate Creating a Load Collector Modifying Commands to Create Generalized Macros

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 3 HyperMesh Commands HyperMesh command macros make use of only HyperMesh commands. HyperMesh writes all commands used in a session to the command.cmf file. The command.cmf file is an ASCII file that HyperMesh can read or write. If this file doesn't already exist, then HyperMesh creates it at the start of a session. If the file does already exist, HyperMesh adds the commands for the new session to the end of the original file. You can use command files in applications that rely on repetitive or iterative steps, or to create demonstrations.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 4 HyperMesh Commands Command files follow this syntax: A command begins with an asterisk (*). A command ends with the left parenthesis. The parameters for a command are separated by commas, ending with the right parenthesis. Command syntax example: *shrink(.2) Commands executed in an active HyperMesh session are not immediately written to the command files. They are stored in memory and are written to the command file during idle time (when HyperMesh is not busy performing user operations).

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 5 HyperMesh Commands Entity Types Used as string parameters in commands that act directly on entities in some fashion, such as creating filtered sets that contain only a specific entity type. Examples of entity types are elements, line, groups, sets, and loads. Marks Marks specify groups of entities that are transferred to the command processor. Marks can be created for most entities, and commands are then issued to perform operations on the entities on the mark. HyperMesh allows for two standard marks and a user mark. Standard marks are referenced by the mark IDs 1 and 2.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 6 HyperMesh Commands Example of how to delete elements using the standard mark: *createmark(elements, 1) *deletemark(elements, 1) This *createmark command populates mark 1 with elements 50, 51, and 52. The *deletemark command deletes the elements contained on mark 1. Element ids will not be consistent from model to model. In order to make a macro useful for multiple models, we can change the selection method.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 7 HyperMesh Commands Using Selection Methods with a Mark – several options exist to make the *createmark command more general “all”, “by displayed“, “by config”, etc Use the *appendmark() command to add entities to a mark. *createmark(elements, 1) *appendmark(elements, 1) “by adjacent” *deletemark(elements, 1) Another option is to replace the *createmark command with *createmarkpanel. When executed, this command presents the user with a selection panel in the entity specified in the command can be selected.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 8 HyperMesh Commands At times, it is necessary to define a vector or plane for a command. HyperMesh allocates two vectors and two planes with the IDs 1 and 2. The vectors and planes can be defined at any time during the processing of a command file or Tcl script. The following example translates node 10 along the x axis by 5 units: *createvector(1, 1.0, 0.0, 0.0) *createmark(nodes, 1) 10 *translatemark(nodes, 1, 1, 5.0) Additionally, a normal and base point are required to define a plane. *createplane(1, 1.0, 0.0, 0.0, 5.0, 0.0, 0.0) *createmark(elements, 1) “displayed” *reflectmark(elements, 1, 1)

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 9 HyperMesh Commands Command Name Description *appendmark() Add additional entities to a mark *beginmacro(name) Start the definition of a Utility Menu macro *callmacro() Call a macro from within another macro *createbutton() Add a button to the Utility Menu *createbuttongroup () Add a button group to the Utility Menu *createlistpanel() Allow you to interactively select a list of entities *createmarklast() Place the entities from the last operation into a mark *createmarkpanel() Allow you to interactively select entities *createtext() Add text to the Utility Menu Command Name Description *endmacro() End the definition of a macro started with the beginmacro command *enterpanel() Enter the passed HyperMesh panel *includemacrofile() Include the contents of the passed macro file *insertbutton() Insert a button into the Utility Menu *inserttext() Insert text into the Utility Menu *setactivegroup() Set the default selection for a button group *setactivepage() Set the current displayed Utility Menu page *setbuttongroupactivecolo r() Set the color for the Utility Menu button group’s current selection indicator Common Command File Commands

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 10 HyperMesh Macro Structure HyperMesh macro commands are enclosed by the *beginmacro() and *endmacro() commands. *beginmacro(macroName) [commands] *endmacro() Macros may accept data passed to them using the arguments $1, $2, etc. Each argument specifies where the values should be substituted. *beginmacro(ToggleGeom_macro) *displaycollectorwithfilter(comps,$1,””,0,1) *plot() *endmacro() *createbutton(5, “Turn off all geometry”, -1, 0, 10, GREEN, “Turn off the display of all geometry”, “ToggleGeom_macro”, “none”)

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 11 Process to Create HyperMesh Macros 1.Define the task to be automated. 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 file. 5.Add the commands to the userpage.mac file. 6.Modify the commands as necessary and add macro wrapper commands *beginmacro() and *endmacro(). 7.Add the macro button using the *createbutton() command that will call the new macro defined in Step 6. 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. 12 Example: Automate Creating a Load Collector The purpose of this example is to become familiar with the general process for creating a HyperMesh macro. This example will use the process described above for creating a HyperMesh macro.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 13 Example 1: Automate Creating a Load Collector Summary Followed the process for creating a HyperMesh macro. Creating a macro will not always be as simple as cutting and pasting commands from the command.cmf file. Sometimes macros will have to use extended selection options in order to be general enough to be used on multiple models. Other times the user will need to interactively select entities as well. The next example will explore these options.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 14 Modifying Commands to Create Generalized Macros Simply copying commands from the command.cmf can result in macros being too restrictive. To generalize the macros so that they can be used on multiple models, the *createmark() command will need to be modified. When HyperMesh writes the *createmark() command to the command.cmf file, it operates on entity ids making it very restrictive. Even if a selection method such as “displayed” is used, entity ids are listed in the command.cmf file. As a result, we need to modify the command so that it is less restrictive. We can do this by replacing the *createmark() command with the *createmarkpanel() command. The *createmarkpanel() command allows users to interactively select the entities.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 15 Modifying Commands to Create Generalized Macros The syntax for the *createmarkpanel() command is: *createmarkpanel(entity_type, mark_id, message) entity_type:Type of entity to be placed on the mark mark_id: ID of the mark to be created, 1 or 2 message: Message to display to the user Example: Allow the user to select the elements and then delete the elements *createmarkpanel(elements, 1, “Select elements to delete”) *deletemark(elements, 1)

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 16 Practical Exercises Exercise 3a Description Add a button to the Utility Menu which allows elements on the top of the channel to be translated in the z-direction. Give the users the option of selecting which elements to translate. HyperMesh commands used *createbutton()*beginmacro() *createmarkpanel()*endmacro() *translatemark() TCL/TK commands used none Hints Follow the Process to Create HyperMesh Macros presented in this Chapter. Do all the steps in HyperMesh and extract the appropriate commands from the command.cmf file.