Macros
Method Introduced:
The method
pfcBaseSession.RunMacro() runs a macro string. A
Creo.JS macro string is equivalent to a
Creo Parametric mapkey minus the key sequence and the mapkey name. To generate a macro string, create a mapkey in
Creo Parametric. Refer to the
Creo Parametric online help for more information about creating a mapkey.
Copy the Value of the generated mapkey Option from the > dialog box. An example Value is as follows:
$F2 @MAPKEY_LABELtest;
~ Activate `main_dlg_cur` `ProCmdModelNew.file`;
~ Activate `new` `OK`;
The key sequence is
$F2. The mapkey name is
@MAPKEY_LABELtest. The remainder of the string following the first semicolon is the macro string that should be passed to the method
pfcBaseSession.RunMacro().
In this case, it is as follows:
~ Activate `main_dlg_cur` `ProCmdModelNew.file`;
~ Activate `new` `OK`;
|
|
Creating or editing the macro string manually is not supported as the mapkeys are not a supported scripting language. The syntax is not defined for users and is not guaranteed to remain constant across different datecodes of Creo Parametric.
|
Macros are executed from synchronous mode only when control returns to Creo Parametric from the Creo.JS program. Macros are stored in reverse order, last in, first out.