Circled example

Circled example
 1# this example creates a circle 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    # create some local variables for offset, radius, etc.
15    offset_x = 100
16    offset_y = 100
17    radius = 50
18    start_angle = 45
19    anti_clockwise = 0
20
21    # move to the origin of the active block
22    ab.move_ad(0, 0)
23
24    # create a circle
25    ab.circled(offset_x, offset_y, radius, start_angle, anti_clockwise)
26
27
28
29
30