It looks like you're new here. If you want to get involved, click one of these buttons!
Recently I have received a request regarding automation capabilities for the layer processing functions (boolean operations, sizing and others). To provide a preliminary solution I have supplied a ruby script for download here: http://www.klayout.de/resources/layer_proc.rbm.
The script installs a new menu entry which allows to load and execute a processing script. The script can be used for implement layer generation and manipulation rules. Right now, the implementation is pretty simple and uses a flat approach, i.e. creates shapes in the top cell only.
You will find usage instructions in the script itself. Here is a short example which extracts the gate regions:
active = input("2/0")
poly = input("3/0")
gates = active.and(poly)
gates.output("10/0")
Since, the "and" method is available as the "*" operator, this example can be simplified to
(input("2/0") * input("3/0")).output("10/0")
To use these generation rules, save the script above as a text file and run the script using "Tools/Processing Scripts/Processing Script" to execute the script. To easily execute the script again, a list of most recently used scripts is maintained.
Matthias