Border Plot directly¶
Border Plot directly¶
1# This example creates a border plot for the active drawing. It uses the
2# settings 'To New Project' that creates a new destination drawing.
3
4# Create a local variable for the database
5db = impact.active_database
6
7# Create a local variable for the output toolbox
8ot = impact.gui.output_toolbox
9
10# Clear the output toolbox
11ot.clear()
12
13if not impact.active_drawing.isNone():
14
15 # get a border plot impact.creator
16 bp = db.border_plot_creator
17
18 # assign a border plot settings to use
19 bp.settings = db.find_master_tool_setting("Examples|Destinations|To New Project", ipMasterSettingType.mstBorderPlot)
20
21 # assign the source drawing
22 bp.source_drawing = impact.active_drawing
23
24 # check the settings loaded and all areas are matched
25 if bp.valid:
26
27 # create the border plot
28 if bp.create():
29
30 # check for a destination drawing
31 drawing = bp.destination_drawing
32
33 if not drawing.isNone():
34 ot.add("Successfully created border plot '" + bp.settings.full_name + "' in " + str(drawing.full_name))
35
36 else:
37 ot.add("Successfully output border plot '" + bp.settings.full_name + "'")
38
39 else:
40 ot.add("Unable to create the border plot '" + bp.settings.full_name + "'")
41
42 else:
43 ot.add("Unable to load the border plot settings")
44
45else:
46 ot.add("No Active Drawing")
47