• 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. moveLabels to centre of bBox

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 143
  • Views 7133
  • 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

moveLabels to centre of bBox

santvlsi
santvlsi over 2 years ago

Hi All,

I am trying to move labels to centre of bBox with bindkey and here is my code: 

hiSetBindKey("Layout" "<Key>a" "moveLabels()")
procedure(moveLabels()
cv=geGetEditCellView()
d=setof(l cv~>shapes l~>objType == "label" l~>lpp=='("M2" "pin") && l~>theLabel != "A" && l~>theLabel != "B" && l~>theLabel != "EN")
xco=caadr(cv~>prBoundary~>bBox)/2
getxy=d~>xy
newlist=foreach(mapcar fix getxy list(xco yCoord(fix)))
foreach(c d c~>xy=newlist)
);proc

Above code results in : * dbSetq: Invalid point error.

Can anyone please guide me what's wrong with this code.

Thank you

CS

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago

    I've not tried out your code or tested this, but it looks to me as if you are trying to set the xy attribute of each label to the list of new xy coordinates for all labels. That isn't going to work, of course.

    Probably your final foreach should be:

    foreach((label newXY) d newlist
      label~>xy=newXY
    )

    This is looping over the d and newlist lists in parallel, setting loop variables label and newXY to the corresponding elements in turn.

    A bit of advice - life will be much easier for you if you give variables meaningful names (c, d, newlist are not exactly very expressive), plus you should the variables you create in a let() so they remain local to the moveLabels function. The name of the function should also ideally have a prefix to avoid clashing with anyone else's moveLabel function.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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