Getting the matrix of an insert

Getting the matrix of an insert
 1# This example gets the values of the matrix of the selected insert entity
 2# and outputs the value to the output toolbox.
 3
 4
 5# Find the selected insert entity
 6entities = active_block.entities
 7
 8
 9# Output the matrix of the insert
10def describe_insert(insert):
11    matrix = insert.matrix
12    impact.gui.output_toolbox.add(matrix.to_string())
13
14
15for entity in entities:
16    if entity.selected:
17        if entity.entity_type == ipEntityType.etInsert:
18            describe_insert(entity)
19