Get Entity Extents (Python)

Get Entity Extents (Python)
 1# select all visible entities and delete them
 2impact.active_block.select_all()
 3impact.active_block.delete_selected()
 4
 5# draw an entity
 6impact.active_block.move_ad(0, 0)
 7line = impact.active_block.line_ad( 12.3, 45.6 )
 8
 9# get the extents of the entity
10rect = line.get_extents()
11
12# display the results in the output toolbox
13impact.gui.output_toolbox.clear()
14
15# display extents using individual properties
16impact.gui.output_toolbox.add(rect.left)
17impact.gui.output_toolbox.add(rect.bottom)
18impact.gui.output_toolbox.add(rect.right)
19impact.gui.output_toolbox.add(rect.top)
20
21# display results using BottomLeft and TopRight properties
22impact.gui.output_toolbox.add(rect.bottom_left.X)
23impact.gui.output_toolbox.add(rect.bottom_left.Y)
24impact.gui.output_toolbox.add(rect.top_right.X)
25impact.gui.output_toolbox.add(rect.top_right.Y)
26
27# display the width and height
28impact.gui.output_toolbox.add(rect.width)
29impact.gui.output_toolbox.add(rect.height)