Macros
 
Method Introduced:
wfcWSession.WSession.ExecuteMacro
The method pfcSession.BaseSession.RunMacro runs a macro string. A Creo Object TOOLKIT Java 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 Tools > Options 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 pfcSession.BaseSession.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.
The method wfcWSession.WSession.ExecuteMacro executes the macros previously loaded using the method pfcSession.BaseSession.RunMacro.
Was this helpful?