Get Entity Extents

Get Entity Extents
 1# select all visible entities and delete them
 2active_block.select_all()
 3active_block.delete_selected()
 4
 5# draw an entity
 6active_block.move_ad(0, 0)
 7line = 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)
30
31