Border Plot Page Numbering¶
Border Plot Page Numbering¶
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# It changes the starting page number so when chaining multiple reports
4# together you can ensure that the page numbering is correct
5
6# Create a local variable for the database
7db = impact.active_database
8
9# Create a local variable for the output toolbox
10ot = impact.gui.output_toolbox
11
12# Clear the output toolbox
13ot.clear()
14
15if not impact.active_drawing.isNone():
16
17 # get a border plot impact.creator
18 bp = db.border_plot_creator
19
20 # assign a border plot settings to use
21 bp.settings = db.find_master_tool_setting("Examples|Destinations|To New Project", ipMasterSettingType.mstBorderPlot)
22
23 # assign the source drawing
24 bp.source_drawing = impact.active_drawing
25
26 # start page numbering at 5
27 bp.starting_page_number = 5
28
29 # check the settings loaded and all areas are matched
30 if bp.valid:
31
32 # create the border plot
33 if bp.create():
34
35 # check for a destination drawing
36 drawing = bp.destination_drawing
37
38 if drawing is not None:
39 ot.add("Successfully created border plot '" + bp.settings.full_name + "' with " + str(bp.total_pages_generated) + " page(s) in " + str(drawing.full_name))
40
41 else:
42 ot.add("Successfully output border plot '" + bp.settings.full_name + "'")
43
44 else:
45 ot.add("Unable to create the border plot '" + bp.settings.full_name + "'")
46
47 else:
48 ot.add("Unable to load the border plot settings")
49
50else:
51 ot.add("No Active Drawing")