ExecuteFile

ExecuteFile
 1# This example shows the use of COM script calling other scripts and also IML
 2
 3# Create a local variable for the impact impact.gui object
 4g = impact.gui
 5
 6# Create a local variable for the output toolbox
 7ot = g.output_toolbox
 8
 9# clear the output toolbox
10ot.clear()
11
12# check there is an active drawing
13if impact.active_drawing.isNone():
14
15    # display an error message in the output toolbox
16    ot.add("Unable to continue: there is no active drawing")
17else:
18
19    # Run Macro
20    filename = "Calling1.run@FirstMacro"
21    g.tools.execute_file(filename)
22
23    # script
24    filepath = "Comparison using IVector.Equals.txt"
25    g.tools.execute_file(filepath)