Adding cell to existing (open) GDS file

Hi I am having trouble adding a new cell to an existing open GDS file.

Here is my code:

module MyMacro
  include RBA
  main_window = RBA::Application::instance.main_window
  layout = RBA::CellView::active.layout
  layout_view = main_window.current_view

  layout.dbu = 0.001
  wg0 = layout.insert_layer(RBA::LayerInfo::new(1, 0))

  cname = "CELLNAME"
  cell = layout.create_cell("#{cname}")

  TEXT OF CODE

  layout_view.select_cell(cell.cell_index, 0)
  layout_view.zoom_fit

end

The code creates a blank cell without any shapes in the existing GDS. If replace the "layout" line with:

  layout = main_window.create_layout(1).layout

a new cell in a new layout is created with the shapes I need.

Comments

  • Hi,

    as I don't see the actual code, it's hard to tell what's wrong. But maybe the problem happens because you create a new layer. New layers aren't visible by default. Try

    layout_view.add_missing_layers
    

    at the end of the script to make them visible.

    Matthias

  • Thanks for the pointer Matthias. Based on your feedback I realized that the layer already existed within the existing GDS and hence I changed the layer definition from:

      wg0 = layout.insert_layer(RBA::LayerInfo::new(1, 0))
    

    to

      wg0 = layout.layer(RBA::LayerInfo::new(1, 0))
    

    Now the code works as expected. Thanks!!

Sign In or Register to comment.