Creating an editable Layout associated with a LayoutView in Qtless mode

I'm playing around with the new Qt-less LayoutView etc objects (working in 0.28.3) in the standalone python module, and I'm having some trouble getting started.

So far, I've figured out the following way to initialize a set of LayoutView, CellView and Layout objects with the expected hierarchy. However, the Layout object is not editable as shown by the printouts.

from klayout import lay, db

layout_view = lay.LayoutView(True)
print(layout_view.is_editable())  # True

layout_view.create_layout(True)
layout = layout_view.active_cellview().layout()

print(layout.is_editable())  # False

Is this the correct way of initializing things, and is there a way to create an editable Layout that is linked to a CellView and LayoutView?

Thanks!

Comments

  • I found a solution, or perhaps workaround. After calling create_layout, one can replace the non-editable layout with a new editable instance with the assign method:

    from klayout import lay, db
    
    layout_view = lay.LayoutView(True)
    print(layout_view.is_editable())  # True
    
    layout_view.create_layout(True)
    layout_view.active_cellview().layout().assign(db.Layout())
    
    layout = layout_view.active_cellview().layout()
    print(layout.is_editable())  # True
    
  • I see ... maybe that is a bug. I will check that.

    I need to say that editing layouts in the Qtless view is not the initial scope. We introduced it for remote visualization. I'm not sure if all edit functions will work from a Qtless view.

    Matthias

  • Thanks for checking!

    The only operations we use are removing some shapes or cells in a layout, these seem to work fine with the above workaround (and have always worked if we just instantiate a bare Layout). It's very neat that we can now render images this way :)

  • Very good .. I found and fixed the issue and will release it with 0.28.4.

    Matthias

Sign In or Register to comment.