Convert PCell to Static Cell

edited May 2014 in Ruby Scripting
Dear Matthias,

In the GUI there is a function that converts PCells into static cells. Can I call the same functionality from Ruby?

The background is that I use the TEXT PCell from the Basic library to create text. Nevertheless I would rather deal with statics cells only and not have them in the final GDS.

Danke!

so long...
Marko

Comments

  • edited May 2014

    Perhaps Matthias already has a function.

    If not, a workaround is to use something like

    RBA::Application.instance.main_window.menu.action("edit_menu.selection_menu.convert_to_cell").trigger
    

    This is not a great idea though as it may not always be the same in future KLayout versions and it only works on the selected object, not an arbitrary object you specify in code. But it's a quick and dirty solution.

    Another slightly better option is the "copy_cells" method described here:

    http://klayout.de/forum/comments.php?DiscussionID=103
    

    I have found that this method converts PCells to static cells.

  • edited June 2014

    Hi all,

    since 0.23.x there is a method Layout#convert_cell_to_static which converts a PCell to a static cell. It takes the cell index of the proxy cell (that is a representative of the PCell in the layout) and creates a new cell which is basically a copy of that proxy, but without the connection to the PCell.

    This method can also convert library proxies to normal cells - in that cast, the new cell will not have a connection to the library. And of course it can convert proxies to PCells in libraries ...

    Please note, that this method just creates a new cell. It does not replace the instances of the cell by instances to the new cell. This has to be done separately, for example by iterating the parent instances of the proxy cell and replacing instance by instance with instances to the new cell.

    Matthias

  • edited February 2015

    Matthias,

    I would like to use Layout#convert_cell_to_static as you say, to convert a PCell (say, all PCells on the layout for argument's sake) to static cell.

    However for this I need to get the PCell's cell index. When I try to get a "handle" on the PCells, I cannot seem to do it. For example, this code

    layout.each_cell do |cell|
      # Do something with each cell
    end
    

    simply returns all the NON-pcell cells. For example if I have cells called "PARENT", "CHILD", and "Basic.ARC(r=100.000..200.000,a=0..90)", then only PARENT and CHILD are indexed inside the block.

    How do I get the indices of the PCells in a layout?

    Thanks,
    David

  • edited November -1

    Hi David,

    That is strange. I just created a tiny sample, and ARC appears in the cell list obtained with layout.each_cell ... It's just that it's called "ARC", not "Basic.Arc(r=...)".

    "each_cell" is supposed to deliver the PCell proxy cells too. So there has to be another reason.

    Matthias

Sign In or Register to comment.