• 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. how can you get the current grid settings

Stats

  • Replies 7
  • Subscribers 160
  • Views 16032
  • Members are here 0
More Content

how can you get the current grid settings

Ejlersen
Ejlersen over 15 years ago

Hi

Is there a way to get the current grid settings? I've looked over the documentation without finding anything, so hopefully someone here knows how to?

Best regards

Ole

  • Sign in to reply
  • Cancel
Parents
  • fxffxf
    fxffxf over 15 years ago

     you can try a recent 16.3 isr and use the axlDBGridGet

     

      NAME
    axlDBGridGet - get grid values
    SYNOPSIS
    axlDBGridGet(
    nil
    ) ==> lt_grids

    axlDBGridGet(
    t_gridName
    ) ==> og_grid
    FUNCTION
    Returns current grid values. Function has two modes:
    - if gridname is nil returns list of names
    - If given a grid name return its grid characturistics (see below)

    Reserved grid name is "non-etch" otherwise grid names follow Allegro
    ETCH subclass names.

    Use axlDBDisplayControl to control grid color and visibility.

    Grids have the following attributes:

    NAME TYPE DESCRIPTION
    ----------------------------------------
    objType string Name of the object - grids
    readOnly nil can modify object
    name string Name of grid
    xOrigin dbrep X origin of grid
    yOrigin dbrep Y origin of grid
    xMajor dbrep Major X spacing of grid (read-only)
    yMajor dbrep Major Y spacing of grid (read-only)
    xGrids l_dbrep Spacings X of grid (always a list of dbreps)
    yGrids l_dbrep Spacings Y of grid (always a list of dbreps)

    NEEDS
    t_gridName -- name of grid or nil to get all grir names
    RETURNS
    lt_gridds -- list of grids
    og_grid -- disembodied property list containing grid settings
    SEE ALSO
    axlDBGridGet
    EXAMPLE
    # get and print all grids
    grids = axlDBGridGet(nil)
    foreach(g grids
    grd = axlDBGridGet(g)
    printf("GRID name=%s values=%L\n", grd->name, grd)
    )


    NAME
    axlDBGridSet - set the design grid
    SYNOPSIS
    axlDBGridSet(
    og_grid
    ) ==> t/nil
    FUNCTION
    This modifies the grid settings in the design.

    In addition to the grid names (see axlDBGridGet), two symbolic
    grid names are available:
    'all - sets all grid values
    'etch - sets all ETCH grid values

    As a convenience when setting a single the xGrids or yGrids attribute,
    you can use a float.

    Both xMajor and yMajor values are automatically determined by the sum
    of the spacings in xGrids and yGrids respectively.
    NOTES
    - Non etch grids may not have multiple spacings. We only use the
    first grid seen.
    - Setting grids is not undo-able (this may change in the future).
    - Etch grids names are the same as ETCH layer names. This may
    change in the future.
    - Origin values must be within drawing extents or 0.
    - If Grid dialog is open it will not be updated if you change the grid
    settings via this API.
    NEEDS
    og_grid - a grid disembodied property list from axlDBGetGrid
    RETURNS
    t if changed grid, nil if failure
    SEE ALSO
    axlDBGridGet, axlDBDisplayControl
    EXAMPLES
    1) Modify TOP grid settings
    grid = axlDBGridGet("TOP")
    grid = axlDBG
    2) Modify all grids ( note allow xGrids and yGrids to NOT be listed)
    grid = axlDBGridGet("TOP")
    grid->name = 'all
    grid->xGrids = 5.0
    grid->yGrids = 5.0
    axlDBGridSet(grid)
    3) Modify all etch grids
    grid = axlDBGridGet("TOP")
    grid->name = 'etch
    grid->xGrids = '(5.0 7.0)
    grid->yGrids = '(5.0 6.0)
    axlDBGridSet(grid)
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • fxffxf
    fxffxf over 15 years ago

     you can try a recent 16.3 isr and use the axlDBGridGet

     

      NAME
    axlDBGridGet - get grid values
    SYNOPSIS
    axlDBGridGet(
    nil
    ) ==> lt_grids

    axlDBGridGet(
    t_gridName
    ) ==> og_grid
    FUNCTION
    Returns current grid values. Function has two modes:
    - if gridname is nil returns list of names
    - If given a grid name return its grid characturistics (see below)

    Reserved grid name is "non-etch" otherwise grid names follow Allegro
    ETCH subclass names.

    Use axlDBDisplayControl to control grid color and visibility.

    Grids have the following attributes:

    NAME TYPE DESCRIPTION
    ----------------------------------------
    objType string Name of the object - grids
    readOnly nil can modify object
    name string Name of grid
    xOrigin dbrep X origin of grid
    yOrigin dbrep Y origin of grid
    xMajor dbrep Major X spacing of grid (read-only)
    yMajor dbrep Major Y spacing of grid (read-only)
    xGrids l_dbrep Spacings X of grid (always a list of dbreps)
    yGrids l_dbrep Spacings Y of grid (always a list of dbreps)

    NEEDS
    t_gridName -- name of grid or nil to get all grir names
    RETURNS
    lt_gridds -- list of grids
    og_grid -- disembodied property list containing grid settings
    SEE ALSO
    axlDBGridGet
    EXAMPLE
    # get and print all grids
    grids = axlDBGridGet(nil)
    foreach(g grids
    grd = axlDBGridGet(g)
    printf("GRID name=%s values=%L\n", grd->name, grd)
    )


    NAME
    axlDBGridSet - set the design grid
    SYNOPSIS
    axlDBGridSet(
    og_grid
    ) ==> t/nil
    FUNCTION
    This modifies the grid settings in the design.

    In addition to the grid names (see axlDBGridGet), two symbolic
    grid names are available:
    'all - sets all grid values
    'etch - sets all ETCH grid values

    As a convenience when setting a single the xGrids or yGrids attribute,
    you can use a float.

    Both xMajor and yMajor values are automatically determined by the sum
    of the spacings in xGrids and yGrids respectively.
    NOTES
    - Non etch grids may not have multiple spacings. We only use the
    first grid seen.
    - Setting grids is not undo-able (this may change in the future).
    - Etch grids names are the same as ETCH layer names. This may
    change in the future.
    - Origin values must be within drawing extents or 0.
    - If Grid dialog is open it will not be updated if you change the grid
    settings via this API.
    NEEDS
    og_grid - a grid disembodied property list from axlDBGetGrid
    RETURNS
    t if changed grid, nil if failure
    SEE ALSO
    axlDBGridGet, axlDBDisplayControl
    EXAMPLES
    1) Modify TOP grid settings
    grid = axlDBGridGet("TOP")
    grid = axlDBG
    2) Modify all grids ( note allow xGrids and yGrids to NOT be listed)
    grid = axlDBGridGet("TOP")
    grid->name = 'all
    grid->xGrids = 5.0
    grid->yGrids = 5.0
    axlDBGridSet(grid)
    3) Modify all etch grids
    grid = axlDBGridGet("TOP")
    grid->name = 'etch
    grid->xGrids = '(5.0 7.0)
    grid->yGrids = '(5.0 6.0)
    axlDBGridSet(grid)
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
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