It looks like you're new here. If you want to get involved, click one of these buttons!
Hi sir , May I know how to using scripting to get a cell instance / pattern / polygon information?
in DRC function , I knew code as below...
Pattern=input(51,0)
Pattern.data.each.....
after that , we can get the pattern /polygon data from layer #51/0.
but , this code can get data by layer 51/0 only (what the special layer do I define in the input )
Now , I want to know how the pattern layout/ cell instance in the cell named "Bump".
in the cell , that may have pattern in layer 51/0 or 52/0 ....etc...
Is possible to make a code like...
dbGet Info =[dbOpencell $libname Bump]
info.instance.each....
info.shape.each...
by the way , even that , I don't know how to read the layer information in a shape....
sorry to trouble you for that , please help it....
Thanks.
p.s another question about "Help" document , in the document , how to read that ?
When I want to using the document data to get some idea about coding , I can get some table , but no example for that.
if I want to learn Klayout script , how to enter the door?
Comments
Hi,
here is some code in Python to print the contents of the current cell:
I have added some pointers to documentation.
You referred to DRC scripts - this is something different. If you want to code universal scripts, you should stay on the API level and use Ruby or Python (easier to learn I guess).
For learning how to code scripts, I can only offer the documentation. Here is the main entry point: https://www.klayout.de/doc-qt5/programming/introduction.html
Matthias
Hi Sir,
Thanks very much for your code.
I still using (Ruby) DRC scripts to do that and get same result after modify some of code.
the key will be ly.get_info(layer_index) in this case.
But , May I know how to get the layer name (not layer number /purpose) when I have a layer_index?
@jiunnweiyeh If we're talking about GDS files there is no layer name in the layout database. Layers are only addressed by layer number and datatype number. OASIS has layer names (you can get by asking LayerInfo for the name), but that is an optional attribute and it's usually empty.
The layer properties from the LayoutView's layer table you cannot access from a DRC script. That's an entirely different domain.
Matthias