Home > Community > Forums > PCB SKILL > Need guidance on how to select nets, pads, and vias with a certain property

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

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

Last post Mon, Apr 15 2013 10:12 AM by Ejlersen. 19 replies.
Started by mesaman000 25 Mar 2013 12:14 PM. Topic has 19 replies and 2730 views
Page 1 of 2 (20 items) 1 2 Next >
Sort Posts:
  • Mon, Mar 25 2013 12:14 PM

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

    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! 

     

    • Post Points: 20
  • Mon, Mar 25 2013 6:09 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 738
    • Points 16,055
    Re: Need guidance on how to select nets, pads, and vias with a certain property Reply

    It's tough to start your Skill life with something like this.

    Here is some code to get you started:

     

    red = listnindex(axlColorGet('all), '(255 0 0)) || 7

    gray = listnindex(axlColorGet('all), '(190 190 190)) || 2

    spacingConstraint = "TEST"

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

    axlClearObjectCustomColor(axlDBGetDesign() ->nets)

     

    axlSetFindFilter( ?enabled '("noall" "pins") ?onButtons "pins")

    axlAddSelectAll()

    pins = axlGetSelSet()

     

    axlClearObjectCustomColor(pins)

    csetNets = axlSelectByProperty("net", "SPACING_CONSTRAINT_SET", spacingConstraint)

    red_pins = setof(pin, pins, member(pin ->net, csetNets))

     

    axlCustomColorObject(red_pins, red)

    axlVisibleUpdate(t)

    Plottting to a pdf  might be more difficult.

     

    Dave Elder, Tait Communications
    • Post Points: 20
  • Wed, Mar 27 2013 6:34 AM

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

    Hey Dave,

      Thanks a ton for the help.

     

    Just so I can understand a little better, I have a couple questions for you if you don't mind:

    1) Do you know where I can find what arguments these functions take?  I can be a little more independent if I had access to any of these syntaxes but the basic SKILL programming class doesn't really go over any of this stuff besides basic syntax like strcat, local variables, etc.  I've tried searching google all over and can't find what arguments belong to what functions.  I've also tried in the skill prompt to type "help(listnindex)" for example and can't find any documentation

    2) When I try getting the first part to work (just setting everything to gray), nothing happens.  I actually only care about the bottom and top layers being initialized to gray, but anyway I figured it would look something like:

    gray = listnindex(axlColorGet('all), '(190 190 190)) || 2

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

    axlClearObjectCustomColor(axlDBGetDesign() ->nets)

      axlVisibleUpdate(t)

    3) lastly,  I want to set all pins AND vias to the color if they are associated with that specific spacing constraint.  I've modified it to be this:

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

    axlAddSelectAll()

    pins_and_vias = axlGetSelSet()

    axlClearObjectCustomColor(pins_and_vias)

    csetNets = axlSelectByProperty("net", "SPACING_CONSTRAINT_SET", spacingConstraint)

    red_pins_and_vias = setof(pin, pins_and_vias, member(pin ->net, csetNets))

     

    Thanks again for your help! 

    • Post Points: 20
  • Wed, Mar 27 2013 11:59 AM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 738
    • Points 16,055
    Re: Need guidance on how to select nets, pads, and vias with a certain property Reply

    1/ The user and reference manuals are a good place to start. ...\doc\sklangref\sklangref.pdf and ...\doc\sklanguser\sklanguser.pdf. Another quick reference is to look in the documentation for each function ...\share\pcb\examples\skill\DOC\FUNCS

    2/ That should work. Do you get any error messages? Maybe you have some hilighting. Try removing that.

    3/ OK. But don't forget to set the spacingConstraint variable to something.

    Dave Elder, Tait Communications
    • Post Points: 20
  • Wed, Apr 3 2013 1:44 PM

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

    Hi Dave,

      I'm still having trouble setting everything to a grey color initially..  I tried  

    gray = 81 ;; this is the index from the listnindex(axlColorGet('all) for the gray color I want

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

    ;;axlClearObjectCustomColor(axlDBGetDesign() ->nets) 

    axlVisibleUpdate(t) 

     

    Why won't this work?

     

    I'm able to set my pins red using the axlCustomColorObject(list,red), but for some reason I can't color everything else initially to grey.

    Really appreciate the help.  Thanks!

    • Post Points: 20
  • Wed, Apr 3 2013 2:00 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 738
    • Points 16,055
    Re: Need guidance on how to select nets, pads, and vias with a certain property Reply
    Why have you commented out the clearing of the custom colours?
    Dave Elder, Tait Communications
    • Post Points: 20
  • Wed, Apr 3 2013 2:04 PM

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

    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)

     

     

    • Post Points: 20
  • Wed, Apr 3 2013 2:50 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 738
    • Points 16,055
    Re: Need guidance on how to select nets, pads, and vias with a certain property Reply
    Ok, it works for me. Have you turned all other layers (such as PIN/SOLDERMASK_TOP) off?
    Dave Elder, Tait Communications
    • Post Points: 20
  • Thu, Apr 4 2013 8:47 AM

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

    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!

     

    • Post Points: 35
  • Thu, Apr 4 2013 7:01 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 738
    • Points 16,055
    Re: Need guidance on how to select nets, pads, and vias with a certain property Reply

    What you had done should have worked. Try typing

    unique(pin_and_vias ~>objType) 

    It should return ("pin" "via") 

     

    Dave Elder, Tait Communications
    • Post Points: 20
  • Mon, Apr 8 2013 7:01 AM

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

     

    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)

     

     

     

    • Post Points: 5
  • Mon, Apr 8 2013 6:11 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 738
    • Points 16,055
    Re: Need guidance on how to select nets, pads, and vias with a certain property Reply

    You are only setting the TOP layer to gray.

    Try:

    foreach(subclass, axlSubclasses("ETCH")

    foreach(class, '("ETCH" "PIN", "VIA CLASS"), q = axlLayerGet(strcat(class, "/", subclass)), q ->color = gray, axlLayerSet(q))

    Dave Elder, Tait Communications
    • Post Points: 20
  • Tue, Apr 9 2013 6:21 AM

    Re: Need guidance on how to select nets, pads, and vias with a certain property Reply
    hm.. but how does that help the via coloring problem I'm having?
    • Post Points: 20
  • Tue, Apr 9 2013 3:00 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 738
    • Points 16,055
    Re: Need guidance on how to select nets, pads, and vias with a certain property Reply
    I still think that your code should work. You may just need to refresh your view and ensure that you are just looking at etch layers.
    Dave Elder, Tait Communications
    • Post Points: 20
  • Thu, Apr 11 2013 5:34 AM

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

    Hey Dave,

      I've attached a picture of what's happening even after setting all layers/subclasses to become grey and turning universal colors on (all laeyrs are shown but this is only a 2 layer board with a ground plane on the bottom).  All the pads are correct but my vias still will not set for whatever reason.. 

     

    Script problem 
    Thanks again

    • Post Points: 20
Page 1 of 2 (20 items) 1 2 Next >
Sort Posts:
Started by mesaman000 at 25 Mar 2013 12:14 PM. Topic has 19 replies.