22_Workshop11_Macros_Overview

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
WS11-11
7.
ADM704-705, Workshop 11, August 2005 Copyright 2005 MSC.Software Corporation
WORKSHOP 11 - MACROS: OVERVIEW

Saving a recorded macro

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.
WS11-7
WORKSHOP 11 - MACROS: OVERVIEW
7.
Stop the macro recording operation:

From the Tools menu, point to Macro, point to Record/Replay, and then select Record End.
ADM704-705, Workshop 11, August 2005 Copyright 2005 MSC.Software Corporation
WS11-3
WORKSHOP 11 - MACROS: OVERVIEW

Getting started
To import the model:
WS11-8
WORKSHOP 11 - MACROS: OVERVIEW

Reviewing the commands in a recorded macro
To review the commands:
1.
Use the macro editor to see what commands were recorded:

10.
Stop the highlighting mode by clicking the Select tool Main Toolbox.
in the
ADM704-705, Workshop 11, August 2005 Copyright 2005 MSC.Software Corporation
1.
Start ADAMS/View from the mod_11_parameterless_macros directory. Import the wing retraction model, wing_retractor_start.cmd.
2.
ADM704-705, Workshop 11, August 2005 Copyright 2005 MSC.Software Corporation
WS11-6
WORKSHOP 11 - MACROS: OVERVIEW
5.
Choose the center of the view to be near JOINT_15:

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.
WS11-5
WORKSHOP 11 - MACROS: OVERVIEW
4.
Select an Isometric view. Your model should look similar to the following:
ADM704-705, Workshop 11, August 2005 Copyright 2005 MSC.Software Corporation
4.
5.
6.
Modify the recorded macro and insert the following command in the proper location: view zoom auto=on. Run the macro a couple of times. It should no longer be zooming in more and more.

1. 2. 3.
From the Tools menu, point to Macro, point to Record/Replay, and then select Record Start.
ADM704-705, Workshop 11, August 2005 Copyright 2005 MSC.Software Corporation
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-9
WORKSHOP 11 - MACROS: OVERVIEW

You sesemble 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.
WS11-4
WORKSHOP 11 - MACROS: OVERVIEW

Using Macro Record and Macro Replay

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.

From the Tools menu, point to Macro, point to Edit, and then select Modify. In the Database Navigator, select record_macro.

ADM704-705, Workshop 11, August 2005 Copyright 2005 MSC.Software Corporation

To record a series of operations:

Use the macro record feature to save a favorite view and model configuration. Turn on Render view. Turn on the visibility of icons (if they're not on already). Initiate the macro recording operation:
ADM704-705, Workshop 11, August 2005 Copyright 2005 MSC.Software Corporation
WS11-10
WORKSHOP 11 - MACROS: OVERVIEW
2. 3.
Delete the commands B and E from the macro and select OK. Reset the view to some other perspective of the model so you can test the macro. Run the macro again. The view returns to the zoomed view. 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.
8. 9.
Reset your view to a front view and fit to view. Playback the macro you recorded:

From the Tools menu, point to Macro, point to Record/Replay, and then select Execute Recorded Macro. It should have returned your view to the zoomed-in Isometric view. 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.
WS11-2
WORKSHOP 11 - MACROS: OVERVIEW

Problem statement

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.
6.
Zoom in dynamically using the z shortcut, until your view looks similar to the following:
ADM704-705, Workshop 11, August 2005 Copyright 2005 MSC.Software Corporation
WORKSHOP 11
MACROS: OVERVIEW
ADM704-705, Workshop 11, August 2005 Copyright 2005 MSC.Software Corporation
WS11-1
ADM704-705, Workshop 11, August 2005 Copyright 2005 MSC.Software Corporation
相关文档
最新文档