Checking for IML variables

Checking for IML variables
 1# This example checks whether the active drawing contains any old
 2# IML variables and outputs the fact to the output toolbox.
 3
 4# Create a local variable for the active drawing
 5ad = impact.active_drawing
 6
 7# Check that there is an active drawing
 8if not ad.isNone():
 9    if ad.variable_settings.using_iml_variables:
10
11        # Display a message in the output toolbox
12        impact.gui.output_toolbox.add("Drawing contains old IML variables")
13
14    else:
15
16        # Display a message in the output toolbox
17        impact.gui.output_toolbox.add("Drawing does not contain old IML variables")
18
19else:
20
21    # Display a message in the output toolbox
22    impact.gui.output_toolbox.add("unable to continue: no active drawing")