Various Border Plot Area Properties

Various Border Plot Area Properties
 1# this example displays the Name, scale type and scale value of any borderplot entities
 2# within the active block.
 3ot = impact.gui.output_toolbox
 4if impact.active_drawing.isNone():
 5
 6    # display a message in the output toolbox
 7    ot.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 a local variable for the entities in the active block
15    entities = ab.entities
16
17    # iterate the entities and display the Name, scale type and scale value of any
18    # BorderPlot entities
19
20    for entity in entities:
21
22        # set the string to display if possible
23        if entity.entity_type == ipEntityType.etBorderPlot:
24            entity_casted = IBorderPlotArea(entity._com_obj)
25            ot.add("Name: " + str(entity_casted.name))
26            if entity_casted.scale_type == ipBorderPlotScale.bpScaleToFit:
27                ot.add("Scale Type: " + "Scale to Fit")
28            elif entity_casted.scale_type == ipBorderPlotScale.bpScaleBySize:
29                ot.add("Scale Type: " + "Scale By Size 1: Scale")
30            elif entity_casted.scale_type == ipBorderPlotScale.bpScaleByFactor:
31                ot.add("Scale Type: " + "Scale By Factor")
32            ot.add("Scale Value: " + str(entity_casted.scale_value))
33
34