Layer example¶
Layer example¶
1# this example displays the name of the layer the active block belongs to in the
2# output toolbox
3if impact.active_drawing.isNone():
4
5 # display a message in the output toolbox
6 impact.gui.output_toolbox.add("Unable to continue: there is no active drawing")
7
8else:
9
10 # create a local variable for the active block
11 ab = impact.active_drawing.active_layer.active_block
12
13 # display the name of the layer the active block belongs to in the output
14 # toolbox
15 impact.gui.output_toolbox.add(ab.layer.full_name)