Home > Community > Forums > PCB SKILL > Access text xy-center location

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Access text xy-center location 

Last post Mon, Jul 31 2006 12:24 AM by archive. 2 replies.
Started by archive 31 Jul 2006 12:24 AM. Topic has 2 replies and 1789 views
Page 1 of 1 (3 items)
Sort Posts:
  • Mon, Jul 31 2006 12:24 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    Access text xy-center location Reply

    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
    • Post Points: 0
  • Mon, Jul 31 2006 1:23 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: Access text xy-center location Reply

    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
    • Post Points: 0
  • Tue, Aug 1 2006 5:04 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: Access text xy-center location Reply

    Hi Dave,

    Thanks a lot.
    It work!!!

    Shimon


    Originally posted in cdnusers.org by shimon37
    • Post Points: 0
Page 1 of 1 (3 items)
Sort Posts:
Started by archive at 31 Jul 2006 12:24 AM. Topic has 2 replies.