Bindkey needed to list shapes beneath cursor

Discussion in 'Cadence' started by vtcad, May 22, 2008.

  1. vtcad

    vtcad Guest

    Could anyone supply me a bindkey to return a list of shapes beneath my
    cursor in a Layout Window, or a starting point for the code?

    thanks,
     
    vtcad, May 22, 2008
    #1
  2. vtcad

    vlsidesign Guest

    I think whomever answers this, will probably need to know if you
    interested in "only" the shapes that are at the 0 toplevel of
    hierarchy, or also in subcells?
     
    vlsidesign, May 22, 2008
    #2
  3. This should do what you want it to do. (cdba) ----

    procedure(getShapesUnderPt(@optional cv pt level(0))
    let(( retShapes retOvlaps out )
    unless(cv cv = geGetWindowCellView())
    unless(pt pt = enterPoint(?prompts list("Enter Point")))
    if(cv~>lib then
    retOvlaps = dbGetTrueOverlaps(cv list(pt pt) t level)
    retShapes = foreach(mapcar x retOvlaps
    while(listp(x)
    x = cadr(x)
    )
    x
    )
    retShapes = setof(x retShapes x~>objType != "inst")
    out = makeTable( "outTable" nil)
    foreach(x retShapes out[x] = t)
    else
    hiGetAttention()
    printf("%L is not a valid cellView \n" cv)
    )
    out[?]
    )
    )
     
    Dominic DuVarney, May 22, 2008
    #3
  4. vtcad

    Riad KACED Guest

    Hi Dominic,

    May I add a comment on your above code ? just to make it more clear
    for vtcad.
    This code is by default running on the Top level (0), means that the
    functions returns only the sahpes underneath the cursor at the Top
    level. If for example you click on a Pcell, it will return nil.
    So one has to move the : level(0) to 1, 2, ... 20 or whatever desired
    depth. You either hard code this value or give as an argument when
    calling getShapesUnderPt. But in this case, you have to provide the cv
    and pt arguments as well since the order is important with @optional.
    You can use @key otherwise.
    At the end, the function returns a list of dbOject that could be
    easily translated to layer/purpose pair with foreach loop + ~>lpp.
    Thanks Dominic for this code ;-)

    Riad.
     
    Riad KACED, May 23, 2008
    #4
  5. vtcad

    vtcad Guest

    Thanks, the code works great.
     
    vtcad, May 30, 2008
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.