It looks like you're new here. If you want to get involved, click one of these buttons!
If I want to select a shape (say Metal1), copy it to a different layer (say Via1), and go edit->selection->size shapes, to size it down by 1um, is there a way to show the command lines somewhere so that I can record this series of operations and put the codes into a Ruby macro?
Sorry I am fairly new to scripting. So instead of going through the lengthy API document, I am hoping to find an easier way to learn the command line scripts.
Thanks
Comments
Here is what I have so far, with questions embedded
app = RBA::Application::instance
mw = app.main_window
view = mw.current_view
mw.cancel
sel = view.object_selection
How do I apply the menu command to the slected object?
mw.menu.action("edit_menu.copy").trigger
mw.menu.action("edit_menu.paste").trigger
mw.menu.action("edit_menu.selection_menu.size").trigger
How do I pre-enter the size parameter?
mw.menu.action("edit_menu.selection_menu.change_layer").trigger
How do I specify the layer?
Hi,
the menu functions route to the internal implementation. There is no way to access the details by script, because scripts provide only some kind of "side entrance" rather than mapping the basic API. Hence, there is no recording. On the other hand, the API offers access to functionality for which there isn't a UI.
Scripting works on a different level: for example, you would not copy/paste, but rather work with the data objects (in your case: collect the polygonized shapes in a RBA::Region object). There is a lot to say about this, but that requires a deeper understanding of the API. I'm sorry, but the deal with open source is that you either accept it the way it is or contribute (or sponsor) an enhanced implementation.
Here is the "API style" solution I think you are looking for. It lacks handling of some errors (e.g. no layout loaded etc.), but basically it should work:
Matthias
This works. And it's so concise. I love it. Thank you Matthias!