Arcd example

Arcd example
 1# this example creates 4 arcs all with the same radius in the active block
 2
 3# check there is an active drawing
 4if impact.active_drawing.isNone():
 5
 6    # display a message in the output toolbox
 7    impact.gui.output_toolbox.add("Unable to continue: there is no active drawing")
 8
 9else:
10
11    # create a local variable for the active block
12    ab = impact.active_drawing.active_layer.active_block
13
14    # move to the origin of the active block
15    ab.move_ad(0, 0)
16
17    # create a local variable for the radius
18    radius = 50
19
20    # create two local variables for the offset
21    offset_x = 50
22    offset_y = 50
23
24    # create a clockwise large arc
25    ab.arcd(offset_x, offset_y, radius, 0, 0)
26
27    # create an anti-clockwise large arc
28    ab.arcd(offset_x, offset_y, radius, 1, 0)
29
30    # create a clockwise small arc
31    ab.arcd(offset_x, offset_y, radius, 0, 1)
32
33    # create an anti-clockwise small arc
34    ab.arcd(offset_x, offset_y, radius, 1, 1)
35