WS11-1 ADM704-705, Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 MACROS: OVERVIEW.

Slides:



Advertisements
Similar presentations
Microsoft ® Office Training Get up to speed with the 2007 system presents:
Advertisements

CPIT 102 CPIT 102 CHAPTER 1 COLLABORATING on DOCUMENTS.
Tutorial 8: Developing an Excel Application
Microsoft Word 2010 Lesson 1: Introduction to Word.
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
Word Processing Microsoft Office: Exploring Word 2011 for MAC.
Key Applications Module Lesson 12 — Word Essentials
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
Microsoft Office Word 2013 Core Microsoft Office Word 2013 Core Courseware # 3250 Lesson 8: Using Productivity Tools.
Access Tutorial 10 Automating Tasks with Macros
Advanced Tables Lesson 9. Objectives Creating a Custom Table When a table template doesn’t suit your needs, you can create a custom table in Design view.
WS2-1 ADM740, Workshop 2, June 2007 Copyright  2007 MSC.Software Corporation WORKSHOP 2 TEMPLATES VERSUS SUBSYSTEMS.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
Microsoft ® Office 2007 Get up to speed with the 2007 system Murray State University College of Education:
Using Backstage Lesson 2. Objectives Software Orientation: Backstage View Backstage view’s left-side navigation pane (see figure on the next slide) gives.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
1 CA201 Word Application Increasing Efficiency Week # 13 By Tariq Ibn Aziz Dammam Community college.
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-
Mail merge I: Use mail merge for mass mailings Perform a complete mail merge Now you’ll walk through the process of performing a mail merge by using the.
Spreadsheets in Finance and Forecasting Presentation 9 Macros.
Using Office Backstage Using Office Backstage Lesson 3 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
WS16-1 ADM , Workshop 16, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 16 WRAP-UP.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
This tutorial teaches Microsoft Word basics. Although knowledge of how to navigate in a Windows environment is helpful, this tutorial was created for.
Basic Computer and Word Functions, part 1 Read the information and use to answer the questions in the Basic Computer and Word Functions Study Guide.
S9-1 ADM , Section 9, August 2005 Copyright  2005 MSC.Software Corporation SECTION 9 COMMAND LANGUAGE.
Microsoft Office 2007 Access Chapter 6 Using Macros, Switchboards, PivotTables, and PivotCharts.
WS4-1 ADM , Workshop 4, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 4 PARAMETERIZING AN EXISTING MODEL.
Microsoft ® Office Training Get up to speed with the 2007 system.
Create Forms Lesson 5. Objectives Software Orientation The Forms group (below) is located on the Create tab in the Ribbon and can be used to create a.
Key Applications Module Lesson 21 — Access Essentials
ADAMS Assignment 1 ME451:Kinematics and Dynamics of Machine Systems (Fall 2013) Assigned: September 18, 2013 Due: September 25, 2013.
Basic Computer and Word Functions, part 1 Read the information and use to answer the questions in the Basic Computer and Word Functions Study Guide.
GISMO/GEBndPlan Overview Geographic Information System Mapping Object.
WS1-1 ADM740, Workshop 1, June 2007 Copyright  2007 MSC.Software Corporation WORKSHOP 1 OPEN AND RUN AN ASSEMBLY.
WS8-1 ADM740, Workshop 8, June 2007 Copyright  2007 MSC.Software Corporation WORKSHOP 8 Creating Event Files.
Using Advanced Options Lesson 14 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft Word 2013.
WS13-1 ADM740, Workshop 13, June 2007 Copyright  2007 MSC.Software Corporation WORKSHOP 13 EXPLORING AND COMPLETING TEMPLATES.
By Felixberto Dominic B. Eruela.  Using a computer to create, edit, and print documents. Of all computer applications, word processing is the most common.
Fall 2003Sylnovie Merchant, Ph.D. ACCESS Tutorial Note: The purpose of this tutorial is to provide an introduction to some of the functions of ACCESS in.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
S11-1 ADM , Section 11, August 2005 Copyright  2005 MSC.Software Corporation SECTION 11 MACROS: OVERVIEW.
THE C PROGRAMMING ENVIRONMENT. Four parts of C environment  Main menu  Editor status line and edit window  Compiler message window  “Hot Keys” quick.
WS5-1 ADM , Workshop 5, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 5 PARAMETERIZING A NEW MODEL.
Mail merge I: Use mail merge for mass mailings Overview: Mailings en masse What if you need to send to each of your employees a letter containing personal.
WS1-1 ADM730, Workshop 1, September 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 1 INTRODUCTION Open Retracted - Bad Retracted - Good.
ADAMS Assignment 1 ME451:Kinematics and Dynamics of Machine Systems (Spring 09)
WS2-1 ADM , Workshop 2, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 2 EXPRESSIONS: OVERVIEW.
S15-1 ADM740, Section 15, June 2007 Copyright  2007 MSC.Software Corporation SECTION 15 EXPLORING TEMPLATES.
Access Queries and Forms. Adding a New Field  To insert a field after you have saved your table, open Access, and open the table  It is easier to add.
WS1-1 ADM , Workshop 1, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 1 INTRODUCTION.
WS16-1 ADM740, Workshop 16, June 2007 Copyright  2007 MSC.Software Corporation WORKSHOP 16 Using Adams/Linear with Adams/Car.
WS7-1 ADM , Workshop 7, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 7 DESIGN OF EXPERIMENTS.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
Key Applications Module Lesson 12 — Word Essentials Computer Literacy BASICS.
S15-1 ADM , Section 15, August 2005 Copyright  2005 MSC.Software Corporation SECTION 15 DIALOG BOX BUILDER.
Perform a complete mail merge Lesson 14 By the end of this lesson you will be able to complete the following: Use the Mail Merge Wizard to perform a basic.
Excel Tutorial 8 Developing an Excel Application
June 17, 2009 Office 2007 Tips & Tricks.
WORKSHOP 2 VALVETRAIN MECHANISM
WORKSHOP 2 VALVETRAIN MECHANISM
Workshop 1 understanding the command language
A few tricks to take you beyond the basics of Microsoft Office 2010
The SMS Query Menu System for the iSeries
Creating and Modifying Queries
Key Applications Module Lesson 12 — Word Essentials
Key Applications Module Lesson 12 — Word Essentials
Microsoft Excel 2007 – Level 2
Presentation transcript:

WS11-1 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 MACROS: OVERVIEW

WS11-2 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation

WS11-3 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW n Problem statement u In this workshop you will become familiar with writing parameterless macros, while using the wing retraction model used previously in Workshop 9 – Understanding the Command Language and Workshop 10 – Conditional Constructs and Loops. You will be introduced to the differences between macros and command files, you will learn how to use the macro editor, and will write some parameterless macros.

WS11-4 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW n Getting started To import the model: 1. Start ADAMS/View from the mod_11_parameterless_macros directory. 2. Import the wing retraction model, wing_retractor_start.cmd.

WS11-5 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW n Using Macro Record and Macro Replay u One of the simplest ways to create a macro is to record one as you perform operations in ADAMS/View. This recorded macro can then be played back later and the exact same operations will be executed again. n To record a series of operations: u Use the macro record feature to save a favorite view and model configuration. 1. Turn on Render view. 2. Turn on the visibility of icons (if they're not on already). 3. Initiate the macro recording operation: l From the Tools menu, point to Macro, point to Record/Replay, and then select Record Start.

WS11-6 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW 4. Select an Isometric view. Your model should look similar to the following:

WS11-7 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW 5. Choose the center of the view to be near JOINT_15: l From the View menu, point to Position/Orientation, select Center, and then pick roughly at the location of JOINT_15 shown above. Tip: The equivalent keyboard shortcut is c. 6. Zoom in dynamically using the z shortcut, until your view looks similar to the following:

WS11-8 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW 7. Stop the macro recording operation: l From the Tools menu, point to Macro, point to Record/Replay, and then select Record End. 8. Reset your view to a front view and fit to view. 9. Playback the macro you recorded: l From the Tools menu, point to Macro, point to Record/Replay, and then select Execute Recorded Macro. l It should have returned your view to the zoomed-in Isometric view. l You may have noticed that the cursor appears to be active, highlighting objects as you move the mouse around. Almost as if it's in Pick mode, ready for you to pick something on the screen. Let’s investigate why. 10. Stop the highlighting mode by clicking the Select tool in the Main Toolbox.

WS11-9 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW n Reviewing the commands in a recorded macro To review the commands: 1. Use the macro editor to see what commands were recorded: l From the Tools menu, point to Macro, point to Edit, and then select Modify. l In the Database Navigator, select record_macro.

WS11-10 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW l You should see commands in the editor that resemble the following: Note: The text shown in the dialog box above may differ slightly from what you see. Every operation you performed has been recorded. The second line shows an interface command being used. This was the one that put it in Pick mode, and can be removed because you won’t be prompted for the center (it was hardcoded with command C).

WS11-11 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW 2. Delete the commands B and E from the macro and select OK. 3. Reset the view to some other perspective of the model so you can test the macro. 4. Run the macro again. The view returns to the zoomed view. 5. Run the macro again. Notice that ADAMS/View zooms in more. That’s because the commands instruct ADAMS/View to increase the zoom, rather than set it to an exact value. If you don't want that effect, you have to change the commands. For example, you could insert commands for a Fit to View after the Iso. 6. Modify the recorded macro and insert the following command in the proper location: view zoom auto=on. 7. Run the macro a couple of times. It should no longer be zooming in more and more.

WS11-12 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW n Saving a recorded macro u There can only be one macro named record_macro in the database. If you were to start recording again, ADAMS/View would overwrite the one you just created. Rename the macro to save it in the database so it is not overwritten. n To save a recorded macro: 1. Clear the select list by clicking the Select tool on the Main Toolbox. 2. From the Edit menu, select Rename.

WS11-13 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW 3. In the Database Navigator, perform the following: l At the bottom to the right of the Filter box, choose All from the drop- down list. This will allow the macro to be displayed above, as the Database Navigator normally filters macros out. l Select record_macro. l Select OK. l In the Rename Object dialog box that appears, in the New Name text box, enter.my_zoomed_view. l Select OK. 4. How do you think you can run the macro that you just saved? _____Type my_zoomed_view at the command line. _____Use the Command Navigator _____All of the above. _____None of the above.

WS11-14 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation 5. Export the macro to a file: l From the Tools menu, point to Macro, and then select Write. l In the Macro_Name text box, enter.my_zoomed_view. l Leave the File Name text box blank. l Select OK. 6. Open the file with a text editor, and look at the command file that was written. It shares more than just a strong resemblance to a command file because it is a command file. The reason it doesn't look special is because it's a parameterless macro. If the macro had parameters, it would look quite different. You'll learn more about these differences in the next workshop (Workshop 12 – Macros and Parameter Syntax). But for now you will practice recording another macro and then progress to writing a parameterless macro by hand. WORKSHOP 11 - MACROS: OVERVIEW

WS11-15 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW n To record another macro: 1. Now record another macro, whatever you'd like to try. Just make sure you perform a variety of operations, at least five or six things. 2. Playback your newly recorded macro. 3. Did it work as expected? _____ Yes _____ No You probably saw that it did more than you expected, or had problems because it couldn't do certain things twice. In general, the macro record operation is good for short tasks or a minimal set of operations. 4. Look at the recorded macro in the macro editor. 5. Are the commands fairly verbose and perhaps confusing to you? _____ Yes ______ No

WS11-16 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW 6. Do you think it's possible to run the first macro (.my_zoomed_view) now that you've recorded a new macro? ______ Yes ______ No 7. Write T or F to indicate which of the following statements are true or false. ____ You can only run the last default macro you've created. ____ Although the Execute Recorded Macro menu option only lets you run a macro named record_macro, there are other ways to execute a macro. ____ You can run the macro by typing my_zoomed_view in the Command Window.

WS11-17 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW n Writing a parameterless macro u As you saw earlier in the macro editor, the commands recorded can be verbose and perhaps confusing. You can keep your macros concise, clean, and easier to read if you write them by hand. u Create a tool for previewing parts by writing a parameterless macro that displays each part, with a pause between each display operation, and then displays the model when it has finished. n To write a parameterless macro: 1. From the Tools menu, point to Macro, point to Edit, and then select New. The Create /View Macro dialog box opens. By default, the macro name field is MACRO_1.

WS11-18 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW 2. If this macro were created, where do you think it would be stored in the database? Circle one: a).gui.MACRO_1 b).mdi.MACRO_1 c).MACRO_1 d)..MACRO_1 If you're not sure where an object (macro, dialog box, variable, and so on) will be stored by default, provide the absolute object name during creation (that is,.MACRO_1 instead of MACRO_1). 3. Clear the Macro Name text box and enter.Preview_Parts

WS11-19 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW 4. Clear the selection of Use Macro name. Notice that you now have the option to enter your own command in the User-Entered Command text box to be used to execute the macro. 5. Select Use Macro name. 6. Check Yes for Wrap in undo. 7. Enter the following commands in the Commands area. for var=the_part object=(eval(DB_CHILDREN(DB_DEFAULT (.System_Defaults,"model"),"part"))) part display part=(the_part) fit_to_view=yes pause end !for model display fit_to_view=yes

WS11-20 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW 8. Select OK to create the macro. 9. Run the macro by entering preview at the command line. Note: You were able to execute your macro “Preview_Parts” with the abbreviated command preview because it was unique. 10. Press Enter on the keyboard when the Pause dialog box appears (as shown below). Notice that the advantage of using a macro is you now have a command you can use, instead of needing to import a command file every time you want to perform a set of commands. 11. Look in the Command Navigator. See if you can find the command for your macro. 12. Export the macro, Preview_Parts, (using the Tools menu, pointing to Macro, and selecting Write), and name the file Preview_Parts.cmd.

WS11-21 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW n Creating a macro by importing a file u Now that you've written a parameterless macro by hand and learned that they're nothing more than command files, it is fairly straightforward to import them. n To import a macro: 1. Create a parameterless macro from the command file task_1_decision.cmd you used in the last workshop (Workshop 10 –Conditional Constructs and Loops). l From the Tools menu, point to Macro, and then select Read. Complete the dialog box as follows: n Macro Name:.wing_tip_generate n File Name: Browse to task_1_decision.cmd n User Entered Command: marker generate wing_tip n Wrap In Undo: yes n Create Panel: no

WS11-22 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW 2. Select OK. 3. Run the macro. Tip: Use the User-Entered Command. 4. Export the macro. Tip: From the Tools menu, point to Macro, and then select Write. 5. Open the file in a text editor. 6. Do you notice anything that looks different? The first line has a special entry, which is particular to macros. You will learn more about that in the next Module (Macros: Syntax and Parameters). 7. Save your database. 8. Exit ADAMS/View.

WS11-23 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW n Optional tasks 1. Create a parameterless macro from the file show_joint_and_parents_only.cmd. The Preview_parts concept has been extended further to show a joint and its parent parts. It also animates the degrees-of-freedom (DOF) for the joint. To see it in action: l Start a new database. l Import the file completed/optional/test_model.cmd. l Wiggle the joint DOFs by importing the file, create_parameterless_macro.cmd. This file imports the following macros: n show_joints_and_parents_only.cmd user_entered command = show_joints_and_parents n constraint_dof_wiggler.cmd user_entered command = constraint wiggler

WS11-24 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 - MACROS: OVERVIEW l Run the macros using their command. l Open the file, constraint_DOF_wiggler.cmd to see how this macro was created using ADAMS/View commands. Notice how important comments are in documenting your work in a macro.