Macro Example 2
This example shows how layers and layer setup can be handled in macros.
Download: Sample2.layout
This examples as well as a LayoutScript version of it is also included in any LayoutEditor package in the folder macros/examples.
1 #!/usr/bin/layout
2 #name=#2: Layers
3 #help=Handling of layers
4
5 int main(){
6
7 layers::num[10].visible=false;
8
9 int i;
10 i = 6;
11 string s="Layer ";
12 string layerNum6=layers::num[i].name;
13 layers::num[i].name= s+i;
14
15 int k;
16 k=layers::findLayer("Layer 6");
17 layers::num[k].name= layerNum6;
18
19 for (k=1; k<=3 ; k++){
20 layers::num[k+1].visible=false;
21 }
22
23 layers::num[1].setColor(255,100,0);
24 layers::num[1].setStyle(5);
25 return 0;
26 }