Switching the ‘sides’ of entities¶
Switching the ‘sides’ of entities¶
1# This example switches various "sides" of entities in the
2# active block. It is assumed that the first entity in the
3# block is a side-bevel line, the second is a zipper line
4# and the third is a line with a holding bridge.
5
6# get the active block
7block = impact.active_drawing.active_layer.active_block
8
9# get the bevel line
10bevel_line = block.entities.item(1)
11
12# get the zipper line
13zipper_line = block.entities.item(2)
14
15# get the holding bridge line
16holding_bridge_line = block.entities.item(3)
17
18left_side = 0
19path_only = 0
20holding_bridge_both_ends = 0
21
22# switch the bevel side
23block.switch_side(bevel_line, ipSwitchSideMode.ssmBevel, left_side, path_only, holding_bridge_both_ends)
24
25# switch the zipper side
26block.switch_side(zipper_line, ipSwitchSideMode.ssmZipper, left_side, path_only, holding_bridge_both_ends)
27
28# switch the hold bridge side
29block.switch_side(holding_bridge_line, ipSwitchSideMode.ssmHoldingBridge, left_side, path_only, holding_bridge_both_ends)
30
31# view the extents
32impact.gui.active_window.view_extents()