Running a Macro

This task explains the different methods of running a macro.
Method 1
  1. Select the Tools->Macro->Macros... command to display the Macros dialog box:

 

 

In our example, we already created "Macro1.vbs" using VB Script, which is preselected and listed in the available macros list.

Use the "Current macro library or document" field or the "Macro libraries" button if you have other macros available.

  1. Click the Run button to replay the selected macro.


Method 2
  1. Explore your file system and locate the .CATScript file.

  1. Double-click the .CATScript file, or select the file and select the Open contextual command.

A session is started and the macro is executed.

Double-clicking a .catvbs macro does not run the macro.


Method 3
  1. On Windows, run a command like this:

cnext -env CATIA.V5R16.B16 -macro E:\tmp\Mymacro.CATScript

or like this:

cnext -env CATIA.V5R16.B16 -batch -macro E:\tmp\Mymacro.CATScript

to run the macro in batch mode, where "Mymacro.CATScript" is the name of the macro file.

On UNIX, run a command like this:

CNEXT -macro "/tmp/Mymacro.CATScript"

CNEXT -batch -macro "/tmp/Mymacro.CATScript"

or like this:

./catstart -d /CATEnv -env CATIA.V5R16.B16 -object "-macro /tmp/Mymacro.CATScript"

./catstart -d /CATEnv -env CATIA.V5R16.B16 -object "-batch -macro /tmp/Mymacro.CATScript"

to run the macro in batch mode, where "Mymacro.CATScript" is the name of the macro file.

You can add macros to a toolbar using the Tools->Customize... command. Select the Commands tab, then the Macros category: all the macros will be detected and listed. You can then drag and drop them onto toolbars for convenient access.