Ah - of course in the 3rd-to-last line I tell it to create it at (0,0), don't I? Oops.
Well anyway - so I could in this code get the various parameters of the selected shape and from that figure out r, and the x,y location and rotation to place it.…
Note also that I tried calling the MainWindow's redraw method at the end, but no change -- though, that may or may not be the problem.
Note also that the PCells don't show up in the cell tree on the left, which is strange because I can see the text…
Thanks Matthias.
Regarding 1.) I tried this, but while it does place a PCell on the layout, it does not appear to use the selected shape as the PCell input. Instead it just places the PCell at the default position, (0,0).
Here is the code. I could…
Thanks Matthias,
However it tells me
Caught the following exception:uninitialized constant MyLib::MyLib::Circle (Class NameError)
I've tried various things but am not understanding why it sees Circle::new as a constant of MyLib rather than as a c…
Itamar,
I'm not sure this really buys you anything. You can do what you want with only slightly more effort -- either set a breakpoint or step through the code using F11 or the "Step into procedure" button at the top, and then at any poin…
Thanks Matthias,
I took a look and played with the PluginFactory example - and yes it seems it can be done but may be nontrivial.
Thinking more, an acceptable alternative would be to draw a shape (say, a regular box), then press a user-defined key…
Actually it was me ;) but you're welcome.. haha.. and I have another question..
I didn't know win32ole would work, I just found some code online and tried it. So now I am searching for a definitive list of available code (beyond your KLayout docs) …
Hi Bob,
Sounds like Axlsx is not included in the Ruby version.
However if all you want to do is read values from an excel file, here is an example script I wrote that uses win32ole. Note that this works on my installation (KLayout 0.22.9) without …
Never mind, I think I figured it out -- so you don't have to break your rules on publicizing C++ APIs :-). However I have another question.
But first, my attempt at the code. Basically I found libBasicStrokedPolygon to be using an edge processor, s…
This is working, to call .rb scripts.
However now I want to call an .lym script.
For example, I have one code that makes a button on the toolbar as shown next. Then I have a second .lym code (not shown) that I want to just run when the toolbar but…
Thanks, exactly the link I was looking for but somehow missed :)
Good, it appears what I need is a "Coded library" - however few details are given on the page. Could you perhaps provide an example?
I searched for an example and thought I…
Thank you, exactly what I was looking for. I was unfortunately trying to figure out how to use "@toolbar" in the ruby code, however now I see it can be entered into the macro's properties box.
One small follow-on: I can't get the a.icon =…
Fantastic, thanks! I didn't understand about this transformation meant before. The code is working and I paste final code below for future reference of anyone reading this. It may not be the most efficient or best code but it works..
module BoxBoxS…
Aha! For useful reference of anyone else reading this, as for the use of the Pcell itself, to find it you go Instance > Instance tab > Library: Basic, then click "..." button and choose ROUND_PATH. Somehow I didn't find this before.
…
Regarding layer index being a unique identifier and GDS layer/datatype being an annotation -- Understood and agreed. This is a smart way and the only way to do it I think.
But I still think the get/set methods are still just as useful even with tha…
Thanks. I thought "module" was KLayout specific but didn't realize it is from Ruby.
After reading your reply I realized how little Ruby I know and I was just flying by the seat of my pants.
So I read a Ruby book this weekend, almost in i…
Thanks for the very helpful reply.
* Since this has turned from a question to a feature request :) -- then I suppose I would mention that it would be helpful to have methods to set and to get the layer index (.layer and .layer=), methods to set and…
Matthias,
I have same question as Alex. However to follow-on: That's fine if it happens to be coded in C++ instead of Ruby. However I still have the same problem as Alex -- I can't find the C++ version (note that I just want to use it as-is, not ch…
Aha. OK well no problem. For now I found a friend to import it into Cadence and tell me the locations.
Looking forward to the next version too. Great program by the way!
Not sure if this is what you want but there is an erase method in Shapes. http://klayout.de/doc/code/class_Shapes.html
So you could do
module EraseSelectedShape app = RBA::Application.instance mw = app.main_window lv = mw.current_view if lv ==…
Never mind, figured out how to do it. I duplicated the box and added it to the same cell. Then can erase the original box if desired.
I was surprised - it seems a good feature to have would be a "layer=" method within Box, Polygon, etc, w…
This works great now, thanks.
I made the changes you recommended and all works great. I understand the difference between .lym and .rbm now.
Pasting the final code below in case future readers are interested.
Thanks
module Curve90DegBendsRibBool…
However now another question :)
This works fine (total code pasted below) in the following case:
* Make a new layout, new top cell called "top", new layer called layer 1, new layer called layer 6.
* Draw a wire e.g. 1um wide, on the &q…
I figured out why I was having strange shortcut key issues.
If I simply remove this wrapper from my entire code:
class MenuAction < RBA::Action def initialize( title, shortcut, &action ) self.title = title self.shortcut = shortcut …
Never mind, figured it out!
For any future readers interested, here is how I did it:
layernum = 6datatypenum = 0out_layer = layout.layer_indices.find do |li| info = layout.get_info(li) info.layer == layernum && info.datatype == datat…
Thanks Matthias,
Regarding the shortcut key - it still appears to not be working. Here are the steps I do:
1. Open Macro Editor2. Open the script I want, inside [Local].3. Now I am viewing that script in the panel on the right. 4. Click the button…
I succeeded in doing this - at least a rough version (e.g. no error checking on manhattan geometry input etc). I pasted the code below in case future users are interested.
However a few questions:
* How do I assign a shortcut key? I see in Macro D…