Running a query¶
Running a query¶
1# This example opens the browser using a specified query
2
3# Create a local variable for the impact.gui
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# Create a local variable for the name of the query
13query_name = "Drawing table searches|Created last week"
14
15# Get the query to find items by
16query = impact.active_database.find_master_tool_setting(query_name, ipMasterSettingType.mstDBQuery)
17
18# Check the query exists
19if query.isNone():
20
21 # Add a message to the output toolbox
22 ot.add("Unable to find query '" + str(query_name) + "'")
23
24else:
25
26 # Open the browser using the specified query
27 g.open_browser_run_query2(query)