• 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 to group the net objTypes?

Stats

  • Replies 6
  • Subscribers 158
  • Views 14961
  • Members are here 0
More Content

how to group the net objTypes?

krthik15
krthik15 over 8 years ago

Hello,

I'm trying to individually group the via,pin,shape and path of the net . but its not working. it shows E- *Error* eval: unbound variable - shapes

axlSetFindFilter(?enabled "Nets" ?onButtons "Nets")

axlSelect()

net_db = axlGetSelSet()

net = car(net_db)

foreach(branch, net ->branches, foreach(child, branch ->children, when(child ->objType == "via",vias= cons(child, vias)), when(child ->objType == "pin", pins= cons(child, pins)), when(child ->objType == "shape", shapes= cons(child, shapes)),when(child ->objType == "path", paths= cons(child, paths)) ))


Regards,

Karthik.k

  • Sign in to reply
  • Cancel
  • DavidJHutchins
    DavidJHutchins over 8 years ago
    I added local variable definitions in a let(() statement & don't get that error:
    procedure(test_code()
    let((net_db net vias shapes pins paths)
    (axlSetFindFilter ?enabled "Nets" ?onButtons "Nets")
    (axlSelect)
    (net_db = (axlGetSelSet))
    (net = car(net_db))
    foreach(branch
    (net->branches)
    foreach(child
    (branch->children)
    when(((child->objType) == "via")
    (vias = cons(child vias))
    )
    when(((child->objType) == "pin")
    (pins = cons(child pins))
    )
    when(((child->objType) == "shape")
    (shapes = cons(child shapes))
    )
    when(((child->objType) == "path")
    (paths = cons(child paths))
    )
    )
    )
    )
    )
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • krthik15
    krthik15 over 8 years ago
    David Hutchins,

    Thanks for the reply.

    I have run your code still i get errors

    Skill > load("test.il")
    t
    Skill > test_code
    Enter selection point
    last pick: -7254.751 4315.883
    (dbid:235427968)
    Skill > vias
    E- *Error* toplevel: undefined variable - vias
    nil
    Skill > paths
    E- *Error* toplevel: undefined variable - paths
    nil
    Skill > pins
    E- *Error* toplevel: undefined variable - pins
    nil
    Skill > shapes
    E- *Error* toplevel: undefined variable - shapes
    nil

    Regards,
    Karthik.K
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Kirti Sikri
    Kirti Sikri over 8 years ago

    Hello,

    It's because you are appending to list of objects before declaring it in the following line.

    shapes= cons(child, shapes)

    Add this before foreach and code will work fine

    pins=()
    vias=()

    shapes=()
    paths=()

    You can also declare pins=nil etc. 

    Thanks, 

    Kirti 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • krthik15
    krthik15 over 8 years ago

    Kirti,

    Still it shows same error. Attached my code here.https://community.cadence.com/cfs-file/__key/communityserver-discussions-components-files/28/test_5F00_code.il

    Note : I'm working in APD 16.6

    Skill > load("test_code.il")

    t

    Skill > _testcode

    Enter selection point

    last pick:  -6290.000 4480.000

    (dbid:228070032 dbid:228070008 dbid:227184192 dbid:228173648)

    Skill > vias

    E- *Error* toplevel: undefined variable - vias

    nil

    Skill > shapes

    E- *Error* toplevel: undefined variable - shapes

    nil

    Skill > pins

    E- *Error* toplevel: undefined variable - pins

    nil

    Skill > paths

    E- *Error* toplevel: undefined variable - paths

    nil

    Skill >

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Kirti Sikri
    Kirti Sikri over 8 years ago
    Hello,

    Its because vias , paths etc have been defined as local variables in function _testcode() using let as shown in excerpt below.
    So they cannot be accessed from outside the function.

    procedure( _testcode()

    let( (net_db net vias pins shapes paths )

    To access vias , paths from outside define the variables before procedure definition and remove from inside the function.
    pins=()
    vias=()
    shapes=()
    paths=()

    procedure( _testcode()

    let( (net_db net )

    axlSetFindFilter(?enabled "Nets" ?onButtons "Nets")

    Thanks,
    Kirti
    • 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