• 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. PCB Outline

Stats

  • State Verified Answer
  • Replies 6
  • Subscribers 161
  • Views 7347
  • Members are here 0
More Content

PCB Outline

ivy372
ivy372 over 2 years ago

Hi guys,

I have write a skill that change origin to low-left of the PCB  board.

But how can I change the origin to the Board outline center point?

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

axlCmdRegister( "o_ll" 'o_ll ?cmdType "interactive")
(procedure o_ll()
axlExtentDB()
x = -( caar( axlExtentDB()))
y = -( cadar( axlExtentDB()))
axlDBChangeDesignOrigin( x:y )
axlUIConfirm( "Change Origin to LowLeft.")
)

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

Thanks~

  • Sign in to reply
  • Cancel
  • eDave
    0 eDave over 2 years ago

    Try something like this:

    outlineShp = car(axlDBGetShapes("BOARD GEOMETRY/DESIGN_OUTLINE")) || car(axlDBGetShapes("BOARD GEOMETRY/OUTLINE"))
    if(outlineShp then
    centrePt = axlMidPointLine(outlineShp ->bBox)
    else
    axlClearSelSet()
    axlSetFindFilter(?enabled '("noall", "invisible", "lines"), ?onButtons '("noall", "lines"))
    axlAddSelectAll()
    outlines = setof(obj, axlGetSelSet(), obj ->layer == "BOARD GEOMETRY/OUTLINE")
    xMin = min(caar(car(outlines) ->bBox), caadr(car(outlines) ->bBox))
    yMin = min(cadar(car(outlines) ->bBox), cadadr(car(outlines) ->bBox))
    xMax = max(caar(car(outlines) ->bBox), caadr(car(outlines) ->bBox))
    yMax = max(cadar(car(outlines) ->bBox), cadadr(car(outlines) ->bBox))
    foreach(line, cdr(outlines)
    xMin = min(caar(line ->bBox), caadr(line ->bBox), xMin)
    yMin = min(cadar(line ->bBox), cadadr(line ->bBox), yMin)
    xMax = max(caar(line ->bBox), caadr(line ->bBox), xMax)
    yMax = max(cadar(line ->bBox), cadadr(line ->bBox), yMax)
    )
    centrePt = axlMidPointLine(list(list(xMin, yMin), list(xMax, yMax)))
    )
    axlDBChangeDesignOrigin(axlMXYSub(0:0, centrePt))

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ivy372
    0 ivy372 over 2 years ago in reply to eDave

    Hi eDave,

    Thanks very much~

    But I want to change the origin to the low-left of PCB Board.

    I hope the origin set on the middle line of BOARD GEOMETRY/OUTLINE.

    like below:

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • eDave
    0 eDave over 2 years ago in reply to ivy372

    axlClearSelSet()
    axlSetFindFilter(?enabled '("noall", "invisible", "linesegs"), ?onButtons '("noall", "linesegs"))
    axlAddSelectAll()
    outlineSegments = setof(obj, axlGetSelSet(), obj ->layer == "BOARD GEOMETRY/OUTLINE")
    axlClearSelSet()
    minx = min(apply('min, mapcar('caar, outlineSegments ~>startEnd)), apply('min, mapcar('caadr, outlineSegments ~>startEnd)))
    miny = min(apply('min, mapcar('cadar, outlineSegments ~>startEnd)), apply('min, mapcar('cadadr, outlineSegments ~>startEnd)))
    axlDBChangeDesignOrigin(axlMXYSub(0:0, minx:miny))

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • ivy372
    0 ivy372 over 2 years ago in reply to eDave

    Hi eDave,

    Awesome!

    Thanks very much~

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JITHINDEV
    0 JITHINDEV over 2 years ago in reply to eDave

    Hi eDave,

    Can you please explain me how to execute this code.

    Regards,
    Jithindev

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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