Home > Community > Forums > PCB SKILL > how to get component (or symbol) 's center

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: *

 how to get component (or symbol) 's center  

Last post Wed, Mar 30 2005 8:02 PM by archive. 6 replies.
Started by archive 30 Mar 2005 08:02 PM. Topic has 6 replies and 2397 views
Page 1 of 1 (7 items)
Sort Posts:
  • Wed, Mar 30 2005 8:02 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    how to get component (or symbol) 's center Reply

    hi,all

    how to get component (or symbol) 's center coordinate?

    thanks

    haojingchao .chinese


    Originally posted in cdnusers.org by microhelp
    • Post Points: 0
  • Thu, Apr 7 2005 8:41 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: how to get component (or symbol) 's center Reply

    Hello MicroHelp,

    ------------------------------
    ;obtain component dbid
    axlSetFindFilter( ?enabled list("noall" "components") ?onButtons list("components") )
    axlSelect( ?groupMode nil ?prompt "Please Select Component" )

    ;user clicks component
    component_dbid = axlGetSelSet()

    ;now use bBox to find center
    component_bBox = component_dbid->bBox

    ; ( (LowerLeft_X,LowerLeft_Y) (UpperRight_X,UpperRight_Y)
    ; now just write code to obtain center

    ------------------------------

    Also possible is
    component_position = component_dbid->xy

    however I'm not sure if this will get the 'center' of component

    regards,
    Newbie




    Originally posted in cdnusers.org by Newbie
    • Post Points: 0
  • Tue, Apr 12 2005 4:10 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: how to get component (or symbol) 's center Reply

    thanks very much,
    let me test;

    microhelp .chinese


    Originally posted in cdnusers.org by microhelp
    • Post Points: 0
  • Tue, Apr 19 2005 9:43 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: how to get component (or symbol) 's center Reply

    Hi All,

    Attached is a skill file that draws the bBox of a symbol on the BOARD GEOMETRY/OUTLINE layer.

    to use it
    1. Place ShowbBox.il in your skill directory

    2. Type "skill" on command prompt
    Command> skill

    3. Type " load "ShowbBox.il" "
    Skill> load "ShowbBox.il"

    4. Type "exit"
    Skill> exit

    5. Type "ShowbBox" and click on symbol you want to display the bBox
    Command> ShowbBox


    What i noticed is that sometimes the bBox rectangle isnt 'centered' on the symbol.
    Does anyone know why this is so?

    this will also mean that we cant really use the bBox of symbol to find center of component... sorry microhelp


    I know that using "location" doesnt work as it will be the "origin" of the component when it was created by the librarian.

    Does anyone have a better suggestion as to how to find the center of a component?

    thanks
    newbie




    Originally posted in cdnusers.org by Newbie
    • Post Points: 0
  • Tue, Apr 19 2005 11:37 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: how to get component (or symbol) 's center Reply

    correct file
    please use this


    Originally posted in cdnusers.org by Newbie
    • Post Points: 0
  • Wed, Apr 20 2005 3:46 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: how to get component (or symbol) 's center Reply

    This solution won't work if symbol objects are outside the Assembly outline. A better solution would be to take all the Assembly outline objects of the symbol and find the centre of those.


    Originally posted in cdnusers.org by nzdave
    • Post Points: 0
  • Thu, Apr 21 2005 6:56 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: how to get component (or symbol) 's center Reply

    Posted By nzdave on 4/20/2005 3:46:17 PM
    A better solution would be to take all the Assembly outline objects of the symbol and find the centre of those.




    that would be tough for complicated outlines... so i settled for placebound bBox

    Thanks nzdave


    Originally posted in cdnusers.org by Newbie
    • Post Points: 0
Page 1 of 1 (7 items)
Sort Posts:
Started by archive at 30 Mar 2005 08:02 PM. Topic has 6 replies.