Macros

LaunchMacroFromFile Function VBScriptRun
LaunchMacroFromDoc Function  

LaunchMacroFromDoc Function  

Executes a macro stored in a document from a rule.
A macro is stored in a document when you don't specify any external file before recording it.

Warning: It is up to the user to check that the macro which is run is not going to cause an infinite loop or result in a system crash.

Syntax

LaunchMacroFromDoc(MacroName )

Example

LaunchMacroFromDoc("Macro1") 

LaunchMacrofromFile Function   

Executes a macro CATScript from a rule.

Warning: It is up to the user to check that the macro which is run is not going to cause an infinite loop or result in a system crash.

Syntax

LaunchMacroFromFile("e:\MacroName.CATScript" )

Example

LaunchMacroFromFile("Macro1.CATScript")

Run()  

Runs a macro with arguments.

Warning: It is up to the user to check that the macro which is run is not going to cause an infinite loop or result in a system crash.

Syntax

VB Script.Run(valueOrFeature:ObjectType,...): Void

where valueOrFeature correspond to the macro argument. Macros have arguments that have a particular order. Values assigned to arguments have to be passed in the same order.

Example

You must have created the VB Script.1 macro before creating the rule below:

if PartBody\Pad.1.HasAttribute("String.1") == true
`VB Script.1` .Run(PartBody\Pad.1 .GetAttributeString("String.1"),PartBody\Pad.1.Name() )

Sample

KwrObject.CATPart