Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorjnopaja
    • CommentTimeJun 7th 2016 edited
    I have a ruby algorithm (ported over from another language) which generates a data structure.

    During the generation of the data structure, I allow my user to generate stopping points within a source text file which generates the data. At that point, I take the data within the data structure and generate a layout for view within klayout. This is done independent of klayout's gui.

    The view code is as follows:

    def view_data
    mw = RBA::Application.instance.main_window
    mw.create_view unless mw.current_view
    layout_view = mw.current_view
    layout_view.show_layout(@fb_layout, '', true, true)

    This allows me to show the layout as I am stepping through it, however it is generating new cellviews. Is there a way to clear the previous views so that the only data shown in klayout is the most up to date layout and not have multiple cellviews?
    • CommentAuthorjnopaja
    • CommentTimeJun 7th 2016 edited
    Ok, so instead of calling layout_view.show_layout everytime, I've decided that I only call it the first time. The cell in question is deleted, then created again (thus giving me a new RBA::Cell). After the algorithm completes, I can click on the cell in the hierarchy browser, and view the updates.

    Is there a way to get the CellView index of a cell when I only have a pointer to the RBA::Cell?

    I want to set the newly re-created cell as the active_cellview using
    but I don't know how to get the cellview_index of the RBA::Cell to do so.
    • CommentAuthorMatthias
    • CommentTimeJun 12th 2016


    Maybe that needs some explanation:

    A view can show multiple layouts. Or more precisely: multiple specific cells (plus context) within multiple layouts. These parts are called "cellviews". The are referred to by "@1", "@2" etc. in the layer list for example. The "cellview index" indicates the cell view inside the list of cell views of a layout view. The "active cell view" is the one that most operations refer to - for example operations inside the cell list.

    If you show just one layout, you have only one cellview, so you cannot switch it. Instead, you have to reconfigure the only cellview to show your new cell. You can do this using LayoutView#select_cell(new_cell.cell_index, 0). Here, 0 is the cellview index - i.e. the first one.


    • CommentAuthorjnopaja
    • CommentTimeJun 13th 2016
    That was it. I couldn't figure out which function to use and where to grab the cellview index.