• 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. Need guidance on how to select nets, pads, and vias with...

Stats

  • Replies 19
  • Subscribers 160
  • Views 20114
  • Members are here 0
More Content

Need guidance on how to select nets, pads, and vias with a certain property

mesaman000
mesaman000 over 12 years ago

Hi,

  I'm a beginner to SKILL programming and I took the basic tutorial class but seems to not be many resources for what I need to do.  I'm trying to initialize all pads, etch, via, nets, and shapes to a certain color like GREY.  Once I do that, I want to search the PCB editor database and identify which nets have a certain spacing class property: "1" "2" "3" or "4".   I want all pads and vias with the spacing class property 1 to be RED for example, all pads and vias with the spacing class property 2 to be BLUE, etc.

 Lastly, I want to export a PDF of this color map.  Can someone please help give me an idea of how I can achieve something like this?

 

Something I've started with is roughly like this:

design_dbid=axlDBGetDesign()

scset=axlCnsList("spacing") ;**Say my four spacing constraints are Default, 1, 2, 3, 4

**how do I traverse through all pads and vias?**

comp_dbid_list=design_dbid->components (pads isn't a property of design_dbid, is this the right method?)

foreach(comp_dbid comp_dbid_list

if comp_dbid->scset==1

**how do I change the color of these to RED? 

 

 

If anyone could provide any guidance or help it would be great!  Thank you! 

 

  • Sign in to reply
  • Cancel
  • mesaman000
    mesaman000 over 12 years ago

    Oops, forgot to delete the ;; from the post.  This is actually what I'm testing:

     

     

    ;;gray = listnindex(axlColorGet('all), '(0 255 255)) 

    gray = 81

    foreach(layer, '("ETCH/TOP" "PIN/TOP", "VIA CLASS/TOP"), q = axlLayerGet(layer), q ->color = gray, axlLayerSet(q))

    axlClearObjectCustomColor(axlDBGetDesign() ->nets) 

    axlVisibleUpdate(t)

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 12 years ago
    Ok, it works for me. Have you turned all other layers (such as PIN/SOLDERMASK_TOP) off?
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mesaman000
    mesaman000 over 12 years ago

    Everything works beautifully now!  Thanks a ton for your help Dave.

     

    The last part I need to complete on this script is doing this for both pins and vias.  The code works the way I want it for just pins now, but how would I also add vias?

     

    axlSetFindFilter( ?enabled (list "noall" "pins" "vias" "invisible")  ?onButtons (list "pins" "vias"))

    axlAddSelectAll()

    pins_and_vias = axlGetSelSet()

     

     

    axlClearObjectCustomColor(pins_and_vias)

    csetNets1 = axlSelectByProperty("net", "SPACING_CONSTRAINT_SET", spacingConstraint1)

    red_pins = setof(pin, pins_and_vias, member(pin ->net, csetNets1))

    csetNets2 = axlSelectByProperty("net", "SPACING_CONSTRAINT_SET", spacingConstraint2)

    green_pins = setof(pin, pins_and_vias, member(pin ->net, csetNets2))

    csetNets3 = axlSelectByProperty("net", "SPACING_CONSTRAINT_SET", spacingConstraint3)

    yellow_pins = setof(pin, pins_and_vias, member(pin ->net, csetNets3))

     

    axlCustomColorObject(red_pins, red)

    axlCustomColorObject(green_pins, green)

    axlCustomColorObject(yellow_pins, yellow)

     

    axlVisibleUpdate(t)

     

    When I do the 'setof' command, how would I also add dbids for vias into that set?  Right now it only collects pins with that spacing class property.  I tried doing them separately like  

    yellow_via= setof(via, pins_and_vias, member(via ->net, csetNets3))

    axlCustomColorObject(yellow_via, yellow)

     

    but that did not work the way I wanted.  Any suggestions would really be appreciated.  Thanks a ton for all of your help!

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 12 years ago

    What you had done should have worked. Try typing

    unique(pin_and_vias ~>objType) 

    It should return ("pin" "via") 

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mesaman000
    mesaman000 over 12 years ago

     

    Yes, here's what I do in my code:

     

    dd=unique(pins_and_vias ~>objType) 

    println(dd)

     and it returns ("pin" "via")

     

    so I validate that pins_and_vias is the set of all pins and vias on the board, so I'm confused why only the pins get the colors update and the vias dont..  This is word for word the code I'm using:

    red = 1

    green = 24

    yellow = 4

    gray = 81

     

    spacingConstraint1 = "TEST1"

    spacingConstraint2 = "TEST2"

    spacingConstraint3 = "TEST3"

     

    foreach(layer, '("ETCH/TOP" "PIN/TOP", "VIA CLASS/TOP"), q = axlLayerGet(layer), q ->color = gray, axlLayerSet(q))

    axlClearObjectCustomColor(axlDBGetDesign() ->nets)

     

    axlSetFindFilter( ?enabled (list "noall" "pins" "vias" "invisible")  ?onButtons (list "pins" "vias"))

    axlAddSelectAll()

    pins_and_vias = axlGetSelSet()

     

    axlClearObjectCustomColor(pins_and_vias)

     

    dd=unique(pins_and_vias ~>objType) 

    println(dd)

     

    csetNets1 = axlSelectByProperty("net", "SPACING_CONSTRAINT_SET", spacingConstraint1)

    red_pins = setof(pin, pins_and_vias, member(pin ->net, csetNets1))

    csetNets2 = axlSelectByProperty("net", "SPACING_CONSTRAINT_SET", spacingConstraint2)

    green_pins = setof(pin, pins_and_vias, member(pin ->net, csetNets2))

    csetNets3 = axlSelectByProperty("net", "SPACING_CONSTRAINT_SET", spacingConstraint3)

    yellow_pins = setof(pin, pins_and_vias, member(pin ->net, csetNets3))

     

    red_via = setof(via, pins_and_vias, member(via ->net, csetNets1))

    green_via = setof(via, pins_and_vias, member(via ->net, csetNets2))

    yellow_via= setof(via, pins_and_vias, member(via ->net, csetNets3))

     

     

    axlCustomColorObject(red_pins, red)

    axlCustomColorObject(green_pins, green)

    axlCustomColorObject(yellow_pins, yellow)

    axlCustomColorObject(red_via, red)

    axlCustomColorObject(green_via, green)

    axlCustomColorObject(yellow_via, yellow)

     

    axlVisibleUpdate(t)

     

     

     

    • 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