Howdy, Stranger!

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

RecursiveShapeIterator

Hi,

How to use the RecursiveShapeIterator from the current cellview on all layers ?

cv = RBA::Application.instance.main_window.current_view
lay = cv.cellview(cv.active_cellview_index).layout
c_i = cv.active_cellview_index

iter = RBA::RecursiveShapeIterator::new(lay, c_i, [])

Thanks, BRgds,
Laurent

Comments

  • edited January 26

    Hi Laurent,

    you can use the recursive shape iterator on all layers of the active cell by doing this:

    cv = RBA::CellView::active
    lay = cv.layout
    cell = cv.cell
    
    iter = RBA::RecursiveShapeIterator::new(lay, cell, lay.layer_indexes)
    while ! iter.at_end()
      puts iter.shape.to_s + " in cell " + iter.cell.name + " on layer " + lay.get_info(iter.layer).to_s
      iter.next
    end
    

    the iteration order will be layers first (scan all layers before advancing to the next cell instance).

    Kind regards,

    Matthias

Sign In or Register to comment.