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 layersmy_layers = axlGetParam("paramLayerGroup:etch")etchcount = 0i = 0foreach(layer my_layers->groupMemberslayerparams = axlLayerGet(strcat("ETCH/" layer))if(layerparams->type=="PLANE" && layerparams->drcPhotoType=="negative" thenpm = 0 ; plot mode negativeelsepm = 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)
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.