SECTION 3 MACROS: OVERVIEW.

Slides:



Advertisements
Similar presentations
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Advertisements

1 Microsoft Access 2002 Tutorial 9 – Automating Tasks With Macros.
Developing an Excel Application
Tutorial 8: Developing an Excel Application
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
The Web Warrior Guide to Web Design Technologies
Finite Element Method FEM Dr. Mohammed Al-Hazmi ANSYS Basics Lecture 4.
Automating Tasks With Macros
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
Guide To UNIX Using Linux Third Edition
Introduction to Unix (CA263) Introduction to Shell Script Programming By Tariq Ibn Aziz.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Exploring Microsoft Excel 2002 Chapter 8 Chapter 8 Automating Repetitive Tasks: Macros and Visual Basic for Applications By Robert T. Grauer Maryann Barber.
Access Tutorial 10 Automating Tasks with Macros
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Introduction to Shell Script Programming
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training course describes how to configure the the C/C++ compiler options.
Microsoft Excel 2007 © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
WS16-1 ADM , Workshop 16, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 16 WRAP-UP.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 11 Committed to Shaping the Next Generation of IT Experts. Chapter 10 Customizing a Database.
S9-1 ADM , Section 9, August 2005 Copyright  2005 MSC.Software Corporation SECTION 9 COMMAND LANGUAGE.
Key Applications Module Lesson 21 — Access Essentials
Microsoft Access 2013 ®® Tutorial 10 Automating Tasks with Macros.
WS11-1 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 MACROS: OVERVIEW.
WS13-1 ADM740, Workshop 13, June 2007 Copyright  2007 MSC.Software Corporation WORKSHOP 13 EXPLORING AND COMPLETING TEMPLATES.
Exploring Microsoft Access Chapter 7 Building Applications: The Switchboard, Macros, and Prototyping.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
S11-1 ADM , Section 11, August 2005 Copyright  2005 MSC.Software Corporation SECTION 11 MACROS: OVERVIEW.
WS2-1 ADM , Workshop 2, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 2 EXPRESSIONS: OVERVIEW.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
SECTION 6 DESIGN STUDY. What’s in this section: –Design Variables –Design Studies Overview –Specifying an Objective –Execution Display Settings –Output.
Excel Tutorial 8 Developing an Excel Application
WORKSHOP 1 introduction
Creating Oracle Business Intelligence Interactive Dashboards
Working in the Forms Developer Environment
SECTION 1 ADAMS/Solver subroutines overview
WORKSHOP 1 CUSTOM TIRE SUBROUTINE
WORKSHOP 14 EXPLORING AND COMPLETING TEMPLATES
INTRODUCING Adams/CHASSIS
Holdings Management Adding, Editing, and Assigning Notes
WORKSHOP 1 STAMPING MECHANISM
Workshop 1 understanding the command language
WORKSHOP 13 SUSPENSION-STEERING SYSTEM
ADAMS/VIEW INTERFACE OVERVIEW
Developing an Excel Application
ADAMS/VIEW INTERFACE OVERVIEW
WORKSHOP 3 GSE IMPORT.
Scripts & Functions Scripts and functions are contained in .m-files
Microsoft Access Illustrated
Microsoft Office Illustrated
Microsoft Excel 2003 Illustrated Complete
Introducing VBA Macros
Exploring Microsoft Excel
CIS16 Application Development Programming with Visual Basic
Access Lesson 2 Creating a Database
Digital Image Processing
A QUICK START TO OPL IBM ILOG OPL V6.3 > Starting Kit >
Stata Basic Course Lab 2.
Lesson 1 - Automating Tasks
CodePainter Revolution Trainer Course
CMPE212 – Reminders Assignment 2 due today, 7pm.
4.4 – List vs Array Exercise 4.1: Array Variables
Microsoft Excel 2007 – Level 2
Presentation transcript:

SECTION 3 MACROS: OVERVIEW

What Is in this section Macro Overview Macro Object Parameters Ways to Create Macros Executing Macros Debugging Macros

MACROS: OVERVIEW Definition A macro is an object that adds a command to the Adams/View language to execute a series of Adams/View commands. Adams/View treats a macro as it does all other Adams/View commands.

MACROS: OVERVIEW (CONT.) Purpose Automate model building, simulating, and reviewing Examples: Generate a series of objects Generate a series of plots for a simulation Build an entire model (one for parts, one for joints, one for forces, and so on). Automate user preferences You can also write macros to automate how you work in Adams/View. For example, you can: Automatically turn icons on or off Specify a certain grid size Set whether or not to use the external Adams/Solver library, and so on. Icon settings (visibility, size, color) Grid settings (on/off, size, and so on) Solver preferences (use external/internal, save files, and so on)

MACROS: OVERVIEW (CONT.) Types Parameterless Executes the Adams/View commands stored in the macro. With parameters You can add parameters to a macro that will be evaluated when the macro is executed. This makes the macro more generic.

MACRO OBJECT PARAMETERS To create a macro, you must specify: Name (for database storage and reference). We recommend that you save your macros in a user-created library. If you save them in the .gui library, they will not be upward compatible. By default, macros are saved at the root level of the database. A command that will run the macro. The default is the macro name. The commands the macro will execute. What to do in case of a subsequent Undo.

WAYS TO CREATE MACROS Macro editor Here, you enter the name of the macro and a unique command string that executes the macro. Command text area

WAYS TO CREATE MACROS (CONT.) Record/Replay You can create a macro by recording a sequence of steps. Once you start the recording process, you perform the operations that you want to be included in the macro. Then, you stop the recording process and play it back. You can also save the macro you just recorded. Reading text from a file You can create a macro by using the Read command to read in an existing command file containing the commands to be executed. You can also assign a help file or text string to the macro that explains the macro’s use. The file you supply that contains the macro definition is a standard command file but it can also contain parameters embedded in the commands and can have special comments at the top.

WAYS TO CREATE MACROS (CONT.) Example for reading text from a file macro read & file_name = "part_replicate_single_mac.cmd" & macro_name = .par_rep_single

EXECUTING MACROS When you create a macro, the command is added to Adams/View language. Command line Enter the command (with any applicable parameters) in the command line of the Command Window. Command line

EXECUTING MACROS (CONT.) Command Navigator The Command Navigator displays a list of all Adams/View command keywords. When you select an object, a dialog box appears in which you enter parameters for executing the command. Selecting this command… Opens this dialog box

EXECUTING MACROS (CONT.) Custom dialog boxes You can create a custom dialog box that upon execution executes a macro. Other macros If needed, a command within a macro can execute another macro.

DEBUGGING macros Using list information and temporary variables Using the ADAMS Command Debugger Crawl-walk-run approach

DEBUGGING (CONT.) Using list information and temporary variables You can debug a macro if you: Create it in pieces. Store the pieces in variables. Get list information on these variables. For more information on building function expression strings in a macro, see the Knowledge Base Article KB8013202, available at: http://simcompanion.mscsoftware.com/infocenter/index?page=content&id=K B8013202 Using the ADAMS Command Debugger Used for heavy development Unsupported and details undocumented

DEBUGGING (CONT.) Crawl-walk-run approach Crawl - Learn the commands Use interface to facilitate. Execute by interface (GUI), Command Navigator, and so on. Review commands and parameters (log file and Command Window). Add to macro editor and test. Walk - Add parameters and qualifiers Declare parameters and simple qualifiers. Substitute parameters into commands. Test. Add looping constructs, if necessary. Use temporary variables. Run - Fine tune Add comment lines Remove dependencies (model object names, environment, and so on). Add error trapping (using IF condition). Add detailed qualifier, as needed.

Exercise Perform Workshop 3, “Macros Overview,” in your exercise workbook