Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

View layers and shapes

Dear all,

I wish to apologise in advance for the simple question, but I am a beginner to both Python/Klayout so I am struggling with some basics to which I could not find an answer myself in the current forum. I have created a test script to create a basic layout, cell (set as top), layers and a box:

import pya

# For updating
initialize_new = True

# Initialize layout
def initialize():
  global mw, layout, cv, layout_view

  mw = pya.Application.instance().main_window()
  layout = mw.create_layout(1).layout()
  cv = pya.CellView().active() = "Wafer Design"
  layout_view = mw.current_view()
  layout.dbu = 1
  dbu = 1/layout.dbu
  print('Layout created: '


# Create new cell and set as top cell 
active_layout = pya.CellView().active().layout()
cell = active_layout.create_cell('Template') = cell

# Layer info's
l1_info =, 0, 'Substrate')
l2_info =, 0, 'Material')
l3_info =, 0, 'Gold')


cell.shapes(l_1).insert(, 0, 3, 3))

This seems to work, but I have found no way to view the actual created layers / shape in this layer, which makes me doubt if I have actually created them. If someone can help me with this basic problem I wish to thank you in advance!

Kind regards,


  • Hi Don,

    No need to apologize. The script isn't wrong :)

    It's just that layers are not automatically shown. The "layer list" is actually a configurable view and not a plain list.

    To make it show the new layers, right-click the layer list and chose "Add Other Layer Entries" or use LayoutView#add_missing_layers in your script.



Sign In or Register to comment.