Home > Community > Forums > PCB SKILL > Modifying ns_gerber.il

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

 Modifying ns_gerber.il 

Last post Mon, Jun 3 2013 12:57 AM by joma. 5 replies.
Started by joma 31 May 2013 08:15 AM. Topic has 5 replies and 956 views
Page 1 of 1 (6 items)
Sort Posts:
  • Fri, May 31 2013 8:15 AM

    • joma
    • Top 500 Contributor
    • Joined on Thu, Jun 14 2012
    • Toulouse, Garonne (Haute)
    • Posts 29
    • Points 535
    Modifying ns_gerber.il Reply

     Hi,

    I am trying to modify the ns_gerber.il to add some extra layers to the conductor films. My if-then statements seem to work ok for the TOP and BOTTOM layers but I cannot get the inner layers to work. If you look at the commented out lines in the code below you can see my various attempts using else, != and using layer names directly. Any help telling me where I am going wrong greatly appreciated.
    Jim O'Mahony

    ; get conductor layers
    my_layers = axlGetParam("paramLayerGroup:etch")
    etchcount = 0
    i = 0
    foreach(layer my_layers->groupMembers
    layerparams = axlLayerGet(strcat("ETCH/" layer))
    if(layerparams->type=="PLANE" && layerparams->drcPhotoType=="negative" then
    pm = 0 ; plot mode negative
    else
    pm = 1 ; plot mode positive
    )

    if(layer=="TOP" then tex = strcat("Texttop")

    else tex=strcat("Text" layer))

    ;if(layer=="L1" then tex = strcat("Text" layer))
    ;if(layer=="L2" then tex = strcat("Text" layer))
    ;if(layer!="TOP" then tex = strcat("Text" layer)

    if(layer=="BOTTOM" then tex = strcat("Textbot"))

     

    sprintf(film_name "%d_%s" ++i layer)
    ld1 = strcat("VIA CLASS/" layer)
    ld2 = strcat("PIN/" layer)
    ld3 = strcat("ETCH/" layer)

    tc = strcat("BOARD GEOMETRY/TOOLING_CORNERS")
    texlayer = strcat("BOARD GEOMETRY/" tex)

    data_list = (list ld1 ld2 ld3 tc texlayer)
    param_list = (list 0 0 0 ulw sbb pm 0 0 0 0 0 1 1)
    (axlfcreate film_name param_list data_list)
    ++etchcount)

    Jim O'Mahony, Studiel Toulouse
    • Post Points: 50
  • Fri, May 31 2013 11:01 AM

    • aCraig
    • Top 50 Contributor
    • Joined on Sat, Aug 16 2008
    • Pepperell, MA
    • Posts 130
    • Points 2,060
    Re: Modifying ns_gerber.il Reply

    The code works fine for me. For each layer I get the correct "tex" strings. What is exactly failing for you?

    Craig

    • Post Points: 5
  • Fri, May 31 2013 12:17 PM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 556
    • Points 9,795
    Re: Modifying ns_gerber.il Reply

    Hi Jim

    I originally created ns_gerber as one of my first skill programs, so depending on how early the code is, please check the mask layers carefully since there was a subclass issue in the very early versions.

    also, please tell me what you're trying to acomplish and I may be able to guide you in the correct direction.

    best regards

    Ole 

    Best regards Ole
    • Post Points: 20
  • Sat, Jun 1 2013 7:22 AM

    • joma
    • Top 500 Contributor
    • Joined on Thu, Jun 14 2012
    • Toulouse, Garonne (Haute)
    • Posts 29
    • Points 535
    Re: Modifying ns_gerber.il Reply

    Thanks guys, I realised my initial mistake after driving home for an hour !
    I think I get no response for the inner layers because they do not exist in the design.

    To explain, I have existing inner layers called textc2(first inner), textc3(second inner) etc. depending on the number of layers in the design. I see from the exising code that Cadence uses L1 for the first inner layer and L2 for the next etc. Having thought about it, I would rather adapt the code to match my existing library layer names than change the library.
    Therefore gives me the problem of how to parse the layer name in order to strip the "L" and leave the layer number (as integer value) and then add one to it (to say variable foo) before using a stringcat("textc" foo) to finish.
    Many years ago I used grep and/or awk to do substitutions but I have no idea how to do that in Skill code.

    Jim

    Jim O'Mahony, Studiel Toulouse
    • Post Points: 5
  • Sun, Jun 2 2013 11:20 PM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 556
    • Points 9,795
    Re: Modifying ns_gerber.il Reply

    Hi Jim

    You already have i as an integer that increases everytime a layer is passed in the code.

    so you could do something like this to run through the if then loop if thats where the trouble is

     

    strcat("textc" sprintf(nil "%d" i))

    if i=3 this would give you textc3 - is that what you're looking for?

     

    The originally idea behind the code was that I've seen a lot of boards fail because somewhere in the process 2 layers was mixed up and the PCB produced did not have the correct layer order. So the code generates a film for each layer in the board but adds an integer number in front to show the correct order as part of the artwork film naming. The code does not really care what naming convention you use for the board, if it is a 6 layer board there will be 6 artwork films for the conductor/plane layers named 1_TOP, 2_yourname of first inner layer, 3_ your name for third inner layert ...... 6_bottom..

    The code should be easy to tweak to suit your needs, but I'm not sure that I understand exactly what it is you want, so if the above does not answer your question, please let me know.

     

    Best regards

    Ole

    Best regards Ole
    • Post Points: 20
  • Mon, Jun 3 2013 12:57 AM

    • joma
    • Top 500 Contributor
    • Joined on Thu, Jun 14 2012
    • Toulouse, Garonne (Haute)
    • Posts 29
    • Points 535
    Re: Modifying ns_gerber.il Reply

    Thanks Ole, that is exactly what I need.

    When we add a layer box to the board it has its own set of subclass layers BOARD GEOMETRY/Texttop etc
    which I need to add to the artwork stack for each of the etch layers.
    My problem is that my main job is the creation of pcbs, while looking for I ways to improve / customise the cad
    system in downtime between projects. That means I need to learn more about Skill functions and variables like
    sprintf, %d, %s etc. when I have the time. Definitely quicker to ask a question on the forum though.

    Thanks again,
    Jim

    Jim O'Mahony, Studiel Toulouse
    • Post Points: 5
Page 1 of 1 (6 items)
Sort Posts:
Started by joma at 31 May 2013 08:15 AM. Topic has 5 replies.