Reddy,
Which example exactly? I'm not familiar with that one. Can you send the link?
Aha, you are using version 0.24.0? Upgrading to the latest version (0.24.1 at time of writing) will fix the problem, as detailed in the Known bugs and issues (scr…
On RedHat, I'm not 100% sure - let me look at those scripts you listed closer. In the meantime try putting the whole TRT folder, unzipped, inside the macros folder. So you have a subfolder called 'The Red Toolbox' inside macros. Restart KLayout.
On…
(Sorry, I keep answering for Matthias, but I hope it's helpful rather than annoying)
First you need the font index. Place a BASIC.Text Pcell and look at its properties. There is a "Font" dropdown. First entry is 0, second is 1, etc. If yo…
It is true, Layer Merge changes boxes to polygons.
If you double-click and are seeing Polygon Properties then it is a polygon. There is no way to access the normal 'box properties' because it is no longer stored internally as a box
You could:
* D…
Canny,
I'm not sure I understand. I have only used TRT on Windows, but the process is perhaps simpler than you thought. You don't need to modify custom-macro-paths of the config file. Just:
* Copy the entire The Red Toolbox folder to inside 'macr…
Thanks Matthias, as always it works like a charm.
(Perhaps you saw the next question coming...): Why need to release resources immediately? Because I have never used the .destroy method for anything else, so would like to know when it is appropriat…
Canny,
Change this line (47)
shape = obj.shape
to this
shape = obj.dup.shape
It is a 0.24 bug as detailed here (scroll down to "A workaround is to use...").
I have already updated all TRT scripts to be compatible in this way, as well…
I should mention what I've tried. Several C++ solutions to this problem I've found online involve using .activateWindow, .raise, and/or .setFocus. I try all three inside button.clicked, but it doesn't work
bd = RBA::BrowserDialog.new("Some t…
See this. Basically:
* Easier to use macros within KL than using KL within something else; KL is an application not an API.
* If you use KL source code in your project then the open source license propagates
* You will have to be more specific abou…
Edit > Search and Replace, Instance cell name ~ ACell, Replace with BCell (note: BCell must already exist in the layout, and I don't think you can't use library cells using this function. If you want to replace with lib cells you will need to do …
Thomas,
Did you manage to find a solution to your original question #1?
I have a similar problem to solve and am looking for an existing scripted solution before attempting my own. Or even if you only have a partial solution right now, that would …
Not a dumb question! The short answer is to use Layout#read method.
Here is some code. It takes an array of folder names (in 'paths' variable) and looks inside these folders. For every gds and oas file it finds, it instances this once at 0,0. You m…
Play with the lines that say
x = x0 + a.x*j + a.y*jy = y0 + b.x*i + b.y*i
I must have it calculated wrong.
x0, y0 is the position of the bottom-left one.
a is the row vector (consists of x and y numbers. To get the x number you just use a.x as y…
I understand now. Any time there is an instance array rather than just an instance, you want each of the array elements' positions.
It's possible there is a slight inconsistency in the desired output you typed. If you manually break the array into …
Hi Phil,
Sorry, it's still not clear to me.. If you could just manually type out the desired output from a small & simple test gds file, that would help.
For example, you could take the test file you linked to earlier (or, preferably, one even…
Ahmed,
If I understand you correctly, you will draw the squares yourself (either manually with the mouse or via script) and then want to convert them to circles? (Correct me if I'm wrong.)
If so, for the latter part of it, take a look at Edit menu…
OK I see now that LayerPropertiesIterator is appropriate, because I forgot that layers in the layer tree can have complicated hierarchical grouping structure, so this handles the case where the user selects the parent group for instance.
So to just…
Thanks. So to confirm, you want it to report 5*6 = 30 xy locations, where each location is the centerx and centery of one of the elements of the "Test" array?
There is no one-line solution I think - these will have to be calculated based …
Your question is not clear to me. Is it possible for you to upload a simple test GDS file somewhere and post a link?
Then, tell me the expected output of the script. Then I can bridge the gap.
I see, sorry. Then I'd do it this way. This iterates over the child instances, so it will get CHILD1 and CHILD2 but not GRANDCHILD1 etc.
ly = RBA::Application::instance.main_window.current_view.active_cellview.layouttopcell = "TOP"parent_…
I am still not sure I understand. So you want text strings and positions or you want cell (actually instance) positions?
If the latter, So let's say you have "TOP" and instanced several times you have cell "CHILD1" and again ins…
By 'names' you mean the text string of a text you have placed at some xy location?
If so, modifying the script above gives
ly = RBA::Application::instance.main_window.current_view.active_cellview.layoutlayer = 1datatype = 0topcell = "TOP"…
I actually observed weird problems with duplication of shapes on top of each other in earlier versions of KLayout, I think it was in 0.23.4 or something. I was never able to pin down the bug but sometimes after some scripts had run and closing and r…
1.) Thanks! I should have tried that..
2.) How about this: Let's say several boxes are selected, with nonzero centerx's. Let's say centerx = 1 for the first selected box currently.
RELATIVE: If you change that to centerx = 1 - 1 (i.e. add a "…
Matthias,
Wonderful work! Much appreciated.
You should expect I have some long discussion post in response :-) So here goes.
A few notes/questions:
(A)
Release notes says "The macro IDE now features watch expressions which are automaticall…
Hi Alex,
I believe you can do this with 'clips' which are available via script (and also via GUI).
I actually haven't used clips before, and don't have time to try in the next couple of days due to other commitments, but you can start to take a lo…