Plotting

Plotting
 1# the MTS folder (if any) followed by the plot machine name followed by the post-processor name
 2settings_name = "Demo Settings|Demo Sample-maker|Pen Plot"
 3
 4# Create a local variable for the active drawing
 5ad = impact.active_drawing
 6if ad.isNone():
 7    impact.gui.output_toolbox.add("Unable to continue: no active drawing")
 8else:
 9
10    # Create a local variable for the active database
11    db = impact.active_database
12
13    # Get the required post processor settings
14
15    # When attempting to find settings of type ipMasterSettingType.mstPostProcessor you should always
16    # prepend the name of the setting with the name of the associated plot machine
17    # setting seperated by a vertical bar
18    settings = db.find_master_tool_setting(settings_name, ipMasterSettingType.mstPostProcessor)
19
20    # Check the settings were found
21    if settings is not None:
22
23        # Create some plot options
24        options = impact.creator.plot_options()
25
26        # Define the plot options
27        options.post_processor = settings
28        options.feed_rate_table_name = ""
29        options.init_codes_name = "Default"
30        options.first_subroutine_number = 1
31        options.rotation = 0
32        options.mirror_x = False
33        options.mirror_y = False
34        options.output_bridges = True
35        options.use_power_reduction = False
36        options.optimise_output = True
37        options.tiled_optimisation = False
38        options.symbols_at_bridge_ends = False
39        options.use_palette_visibility_settings = False
40        options.show_missing_palettes = False
41        options.output_from = ipPlotOutput.poActiveLayer
42        options.use_side_bevel_settings = False
43        options.use_palette_channel_widths = False
44        options.optimise_crease_tools = False
45        options.horizontal_channel_width = 0.0
46        options.vertical_channel_width = 0.0
47        options.has_plot_dialog_data = True
48        options.use_sheet_feeder = False
49        options.sheet_feeder_distance = 0.0
50        options.material_thickness = 0.0
51        options.zcc_number_of_copies = 1
52        options.zccx_repetitions = 0
53        options.zccy_repetitions = 0
54        options.zccx_minimum_distance = 0.0
55        options.zccy_minimum_distance = 0.0
56
57        # Call the plot method to do the plotting
58        impact.gui.tools.plot(options)
59    else:
60        impact.gui.output_toolbox.add("Plot settings not found: " + str(settings_name))