• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Could you please let me know, how I can get the bBox value...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 10615
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Could you please let me know, how I can get the bBox value of a selected metal?

Arokia
Arokia over 3 years ago

Hi Team, 

I'm trying to write a procedure which displays the bBox value of a selected metal in a Layout. Is there a function for this task?

Thanks,

Arokia

  • Cancel
Parents
  • Arokia
    Arokia over 3 years ago

    Ie, it should display the bBox value in the CIW window of virtuoso cadence. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Arokia
    Arokia over 3 years ago in reply to Arokia

    Like for example, the below code will display the x and y coordinates of a selected instance in the CIW window. 

    procedure( getxy()

    let( ()

    coordList = nil

    foreach(item geGetSelSet()

    printf("Selected item coordinate: %L\n" item~>xy)

    coordList = cons(item~>xy coordList)

    )

    )

    )

    But I'm trying to display the bBox values of a selected metal in the CIW window.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to Arokia

    Arokia,

    This code shows how to print the individual bBoxes or the overall bBoxes:

    procedure(CCFshowBBox(@key printIndividual printOverall (figs geGetSelSet()))
      when(figs
        destructuringBind(((ollx olly) (ourx oury)) car(figs)~>bBox
          foreach(fig figs
            when(printIndividual
              printf("Selected item bBox: %L\n" fig~>bBox)
            )
            destructuringBind(((llx lly) (urx ury)) fig~>bBox
              ollx=min(ollx llx)
              olly=min(olly lly)
              ourx=max(ourx urx)
              oury=max(oury ury)
            )
          )
          when(printOverall
            printf("Overall bBox of selected objects: %L\n"
              list(ollx:olly ourx:oury))
          )
          list(ollx:olly ourx:oury)
        )
      )
    )

    To use it:

    CCFshowBBox(?printIndividual t)

    CCFshowBBox(?printIndividual t ?printOverall t)

    CCFshowBBox(?printOverall t)

    depending on what you want. Of course, you may want to adapt as you see fit. What the code does is use destructuringBind to split out the lower left x and y, and upper left x and y, and collect the min and max of these over all items before reassembling into a bBox type list. Note that it slightly unnecessarily visits the first element in the selected set twice, but that was to avoid having an additional printIndividual condition and print outside of the foreach loop.

    Hope that helps!

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to Arokia

    Arokia,

    This code shows how to print the individual bBoxes or the overall bBoxes:

    procedure(CCFshowBBox(@key printIndividual printOverall (figs geGetSelSet()))
      when(figs
        destructuringBind(((ollx olly) (ourx oury)) car(figs)~>bBox
          foreach(fig figs
            when(printIndividual
              printf("Selected item bBox: %L\n" fig~>bBox)
            )
            destructuringBind(((llx lly) (urx ury)) fig~>bBox
              ollx=min(ollx llx)
              olly=min(olly lly)
              ourx=max(ourx urx)
              oury=max(oury ury)
            )
          )
          when(printOverall
            printf("Overall bBox of selected objects: %L\n"
              list(ollx:olly ourx:oury))
          )
          list(ollx:olly ourx:oury)
        )
      )
    )

    To use it:

    CCFshowBBox(?printIndividual t)

    CCFshowBBox(?printIndividual t ?printOverall t)

    CCFshowBBox(?printOverall t)

    depending on what you want. Of course, you may want to adapt as you see fit. What the code does is use destructuringBind to split out the lower left x and y, and upper left x and y, and collect the min and max of these over all items before reassembling into a bBox type list. Note that it slightly unnecessarily visits the first element in the selected set twice, but that was to avoid having an additional printIndividual condition and print outside of the foreach loop.

    Hope that helps!

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information