Changing appearance¶
Changing appearance¶
1# This example changes the impact.gui to use a specified appearance
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 appearance to change to
13appearance_name = "Design Layout"
14
15# Get the appearance setting to change to
16appearance = impact.active_database.find_master_tool_setting(appearance_name, ipMasterSettingType.mstAppearance)
17
18# Check the appearance exists
19if appearance.isNone():
20
21 # Add a message to the output toolbox
22 ot.add("Unable to find appearance '" + str(appearance_name) + "'")
23
24else:
25
26 # Change to the specified appearance
27 g.change_appearance2(appearance)
28