Search in specific area

edited June 2017 in Ruby Scripting

I'd like to do a search on dedocated Instances in a specific area I zoomed in.
I started with but it's not suitable.

app = RBA::Application.instance
mw = app.main_window

Any idea on how to change the lines to receive use the zoomed area as a search area - or do I have to draw a box and get the x,y coordinates of the box.
Thanks a lot in advance,
Andy

Comments

  • edited November -1

    Hi,

    The method you are looking for is:

    RBA::LayoutView::current().box()
    

    This will give you the current view's displayed area in micrometer units.

    For searching a region you need a box in database units. If you're not using view transformations (if you don't know what this is, you probably aren't using it), then you can obtain the box in database units this way:

    view = RBA::LayoutView::current()
    layout = view.active_cellview().layout()
    box_in_um = view.box()
    box_in_dbu = RBA::Box::from_dbox(box_in_um*(1.0/layout.dbu))
    

    Matthias

  • edited November -1
    Hello Matthias,
    Thanks a lot for your feedback - this works for me.

    Best Regards,
    Andy
Sign In or Register to comment.