Secondary Palette (Python)¶
Secondary Palette (Python)¶
1# this example displays the secondary palette of all entities in the active
2# block in the output toolbox
3
4# check there is an active drawing
5if impact.active_drawing.isNone():
6
7 # display a message in the output toolbox
8 impact.gui.output_toolbox.add("Unable to continue: there is no active drawing")
9
10else:
11
12 # create a local variable for the active block
13 ab = impact.active_drawing.active_layer.active_block
14
15 # create a local variable for the entities in the active block
16 ents = ab.entities
17
18 # iterate all the entities in the active block
19 for ent in ents:
20
21 # display the name of the secondary palette of the entity in the output
22 # toolbox
23 impact.gui.output_toolbox.add(ent.secondary_palette)