Printing to default printer (Python)¶
Printing to default printer (Python)¶
1# This example shows how to print the active drawing
2# to the default windows printer without user interaction
3
4# Create a local variable for the output toolbox
5ot = impact.gui.output_toolbox
6
7# Clear the output toolbox
8ot.clear()
9
10drawing = impact.active_drawing
11
12if not drawing.isNone():
13 options = impact.creator.print_options()
14
15 options.show_dialog = False
16
17 if drawing.print(options):
18 ot.add("Successfully printed active drawing to " + options.printer_name)
19 else:
20 ot.add("Unable to print to " + options.printer_name)
21else:
22 ot.add("No impact.active_drawing")