It looks like you're new here. If you want to get involved, click one of these buttons!
Hi,
I would like to switch layouts but without losing the handle
I have the following example code:
mw = pya.Application.instance().main_window()
mw.create_view()
ly1 = pya.Layout()
ly1.read( "design1.oas")
ly2 = pya.Layout()
ly2.read( "design2.oas")
mw.current_view().show_layout(ly1, False)
mw.current_view().show_layout(ly2, False)
mw.current_view().show_layout(ly1, False)
on the last line I am getting the error: Object has been destroyed already for argument #1 ('layout') in LayoutViewBase.show_layout
I understand from it that layoutview.show layout is then destroying the previous design
is there a way to switch layouts views without destroying them?
Comments
No, there is no such switch. Currently, "show_layout" will pass the ownership over the Layout object to the view.
But you can pass a copy:
If that is deleted, your original layout is left intact. But the copy and your original layout are detached. Still it's an option to display a layout object.
Matthias