Editing a Scene Macro

If you perform a task repeatedly, you can take advantage of a macro to automate it. A macro is a series of functions, written in a scripting language, that you group in a single command to perform the requested task automatically.

This task will show you how to edit a scene macro created in the DMU Navigator workbench.

You stored your recorded  macros in a text format file. For more detailed information about macros, read Recording, Running and editing Macros in the Infrastructure User's Guide
1.  You can easily modify the macro instructions specific to DMU Navigator (strings of characters put in bold).
Here is a scene macro example:  (you create a scene through the macro process)

SCENE MACRO

Language="VBSCRIPT"

'*********************************************************

' Purpose: This macro can be used interactively to create a scene and move products within.

'

' Returns: None

'*********************************************************

Sub CATMain()

 

'Deactivate file alert (to avoid interactive message during write of files if any)

Dim FileAlertSave As Boolean

FileAlertSave = CATIA.DisplayFileAlerts

CATIA.DisplayFileAlerts = False

'Find the root of the CATProduct

Dim RootProduct As AnyObject

Set RootProduct = CATIA.ActiveDocument.Product

'Create the scene

Dim TheSceneWorkbench As Workbench

Set TheSceneWorkbench = CATIA.ActiveDocument.GetWorkbench ( "SceneWorkbench" )

Dim Ascene As Scene

Set Scene = TheSceneWorkbench.WorkScenes.AddNewScene ("Scene1", RootProduct)

End Sub

 

EXPLANATIONS

Create the scene launches the scene creation
Scene1 corresponds to the to-be-created scene
RootProduct: corresponds to Product1
For more information, see Creating Scenes.