• 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. Allegro X PCB Editor
  3. Access text xy-center location

Stats

  • Replies 2
  • Subscribers 158
  • Views 13186
  • Members are here 0
More Content

Access text xy-center location

archive
archive over 19 years ago

Hello everybody,

I'm new in usage of a skill language and i need some help.
My question is: how can i access text xy center location
(not xy-origin) in the Allegro database?

Thanks and Best Regards,

Shimon


Originally posted in cdnusers.org by shimon37
  • Sign in to reply
  • Cancel
  • archive
    archive over 19 years ago

    Hi Shimon,

    It is not easy to get the text centre location as it is not an attribute of the text dbid.
    One method to calculate it is to use the height, width and character spacing of the text block that the text uses:

    tbParam = axlGetParam(strcat("paramTextBlock:" txtObj ->textBlock))
    txtHgt = tbParam ->height, chWid = tbParam ->width, chSpc = tbParam ->charSpace

    Alternatively, and more easily, take the bounding box of the text object and find the centre of that:
    bbox = txtObj ->bBox, centre = list((caar(bbox) + caadr(bbox)) / 2.0, (cadar(bbox) + cadadr(bbox)) / 2.0)

    Good luck with Skill and keep the questions coming.

    Cheers, Dave

    Note that neither method will give the exact centre of the actual text graphics.


    Originally posted in cdnusers.org by Dave Elder
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • archive
    archive over 19 years ago

    Hi Dave,

    Thanks a lot.
    It work!!!

    Shimon


    Originally posted in cdnusers.org by shimon37
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

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