I wish to make a simple dot feature (small square) and then repeat that same square at thousands (or tens of thousands) of computer-generated x,y locations. Other software will provide a text file with the x,y coordinates of each feature, and I'd like to use this list to place the origin of a cell with the feature to be replicated. Is this possible in Klayout, and if so, how?
Comments
Hi bunday,
There is not built-in feature for that, but
this problem can be solved through scripting. There is some sample code provide at http://www.klayout.de/doc/programming/database_api.html. Here is some slightly modified version of that:
Maybe you can give some details I can modify the sample accordingly.
Matthias
I am new and was struggling to look for the solution, here is one that can help:
Make sure you have an object in cell on a specific layer. Just select the layer of that object, then..
Tools>VErification>Shapes to Marker>Flat
IN the new window it should select all by default (if it doesnt select all then it might just select 1000 so tweak this in 'configure' option at bottom)
Then on the top right you will see File>Save as>
Save it and you should have a file (.lyrdb) with a lot of stuff including the coordinates positions..(open with notepad or any text editor)
Maybe then you just have to use Matlab or C or some programing langauage to extract these from the text file.
DONE...but the hard way...
Hope it helps. Let me know if you come up with a script ;)
Thanks,
--Bunday
***********text file example starts here, "dotcoordxy"**************
0.000 0.000
1.648 1.366
2.288 0.392
0.185 0.831
1.787 1.331
2.184 1.014
0.825 1.084
0.444 1.798
2.403 0.184
2.278 2.028
0.147 2.278
0.645 1.105
Hi,
Ok, placing a CELL is something different. Here is the sample code (not tested). It assumes you already have created a cell called "SUBJECT" and it creates a new top cell called "TOP" with all these instances:
Matthias
NoMethodError: undefined method `CellInstArray' for RBA:Module
C:/Users/bundayb/KLayout/macros/macrotest12new.rb:19:in `block (2 levels) in <main>'
C:/Users/bundayb/KLayout/macros/macrotest12new.rb:14:in `each_line'
C:/Users/bundayb/KLayout/macros/macrotest12new.rb:14:in `block in <main>'
C:/Users/bundayb/KLayout/macros/macrotest12new.rb:13:in `open'
C:/Users/bundayb/KLayout/macros/macrotest12new.rb:13:in `<main>
Any idea what is wrong? Gotta say I'm not a programmer, I'm a microscopist, so I'm probalby missing something trivial in the syntax...
Sorry, there was a typo. It should say RBA::CellInstArray::new. I edited the script above.
As I said, it's not tested.
Matthias
Hi all,
I have tried the above script and it nicely works when one wants to instance a cell based on a list of coordinates.
I have a follow on question regarding this type of instancing. Is is possible to create discrete paths with varying lengths based on a set of coordinates? For instance if I have the following coordinates;
x1, y1
x2, y2
x3, y3
x4, y4
and if I want to create discrete paths with start and end coordinates like;
(x1,y1):(x2,y2)
(x3,y3):(x4,y4)
where essentially two paths are created which are not connected. Would it be possible to achieve this with scripting?
Any help is much appreciated.
Thanks
klaybur