How to reorder layers / adding layers to an existing project?

While upgrading a design, one may need to go from a 4-layer board to 6-layer, or from 6 to 8, etc. I may need to insert a ground-plane layer in between two existing layers.

I could just disregard the order and then rename the Gerber files, or send instructions to the manufacturer on the correspondence between files and layers.

However, if I have blind or buried vias, the above is not an option, and I want KiCAD/pcbnew to work with the actual order of layers. (plus, relying on manually defining the layers’ order after having exported to Gerber seems ugly anyway)

Is there a “clean” way to do this? The Board Setup dialog does not allow me to drag and drop layers to a different position. I could open the .kicad_pcb file in a text editor and do a search-and-replace to move things from layer X to layer Y. But then, two things: (1) does that work? (or am I overlooking any subtle detail(s) that will become inconsistent after a simple search-and-replace?); and (2) again, I would rather have a cleaner way to do that.

Edit -> Swap Layers…

Thanks eelik.

For the developers: as much as this thread made me laugh super hard (I mean laughing at myself, when seeing the answer, so simple and should-have-been-so-obvious), I do have a few points of critique:

(1) There is no possible valid rationale, IMHO, for having this in a random menu item, and not on the Board Setup dialog, where one configures everything about the layers.

(2) The “Swap Layers” dialog box has zero help! In the manual online, there is no mention of the Swap Layers functionality.

(3) The functionality of the Swap Layers dialog is completely puzzling: I spent at least two or three minutes, and I still have no clue how to work with it and do what I need to do.

I see a column on the left, where I cannot read anything (it’s written on black text on a dark-gray background!). The column is “Move items from layer”, and then the column on the right reads “To layer”. What is that supposed to mean?

  • Do I select one layer to move from and one to move to? Then, does the target layer get the sum of the items originally in it plus the ones moved?
  • I guess not, so I need to select a pair, to swap. But then: why are there two columns? (why is there the “Move to” column) If we’re swapping, we only need to select the two layers to swap, not two “from” and two “to”.
  • Assuming that the selection indicates the layers to swap, then why can I select three rows? Also: does that mean that I can only swap adjacent layers? (this is not a big issue; we can always chain several swaps to accomplish the swap of two non-adjacent layers)

Further puzzling issues: The colored boxes make the cells look like they’re “checkboxes”, but I click on them and nothing happens. Turns out that I have to click and slide the mouse while holding the button pressed, so the whole rectangle gets “selected/highlighted”. Then, if I click on the column on the right, the left box gets unselected :‒\

Bottom line: after all this scratching my head and trying what I think was the only way that could be what I’m supposed to do, I selected, clicked ok, and absolutely nothing happened (nothing that I could see anyway — the “Fille Save” toolbar button did get enabled, so something must have changed; but I didn’t see any change at all in the layers). I also noticed that I can ctrl-click to select, and with ctrl-click I can seem to select more freely from the two columns. Still, absolutely no effect (in this case, even the File Save toolbar button remains disabled, so there really is no effect).

Anyway, I’ll stop my rant. Suffice it to say — developers: I know that this is a rarely used feature, but still; the functionality is horrific. If you don’t want to devote too much work on a rarely used feature, then a very simple solution for the “Swap Layers” dialog is: just offer the user a mechanism to select two layers, period. (and then those two layers get swapped)

Apologies if I’m sounding rude or like I’m yelling at you — I guess you may be being victims of your own success: you’ve created an amazingly good software, with most features being between good and great. So, we the users get spoiled, and then we are baffled and furious when we stumble into a feature with poor functionality!

Cheers,
Carlos

2 Likes

It’s the second time in few days someone was asking how to rearrange layers, not noticing it’s already in the menu. To me it’s a great indicator it might be considered as an improvement for some next big version.
I agree the right place for such a feature is the “Board setup” menu, which could be the single place to specify the board’s details.
Maybe it could also handle some “metadata” used for communicating the details of PCB composition, like: core/prepreg thickness, material type, copper weights, mask color etc.
So when preparing files for the Fab, KiCad could generate some kind of normalized document containing specification for the PCB, based on all this info (stackup definition + metadata).

2 Likes

Huh. That’s odd. Before posting, I was convinced that this would be a relatively common question. I specifically searched in the forum and found nothing. Then, when composing the question, the suggestions for similar topics showed nothing relevant/related.

@eelik wow that’s almost exactly what I thought it should look like. Great!
@cal-linux maybe the title was not that obvious for you, but you’d find your answer here: Delete In1.CU an In4.Cu Layer

So, I was going to add a reply to say that my original question still stands. That I still do not know how to reorder layers, in the sense that “Edit → Swap Layers…” does not answer my question because that feature of the software does not work (by that, what I really mean is: after 24 hours I have not been able to make it do anything at all).

But then … I opened the .kicad_pcb file on a text editor, with the intention of doing search-and-replace, and, lookee lookee what I see on the first screen of text:

(kicad_pcb (version 20171130) (host pcbnew 5.1.5-52549c5~86~ubuntu18.04.1)

  (general
    (thickness 1.6)
    ···
  )

  (page A4)
  (layers
    (0 F.Cu signal)
    (1 GND-plane power hide)
    (2 In2.Cu signal)
    (3 VCC.Cu power hide)
    (4 In3.Cu signal)
    (31 B.Cu signal hide)
    (32 B.Adhes user)
    ····

That’s after I changed it. It was: (3 In3.Cu signal) and (4 VCC.Cu power hide). I swapped those lines and opened the layout in KiCAD, and everything looked ok (read: everything looked exactly as I was expecting after doing what in my mind corresponds to “swap inner layers 3 and 4”)

I still look forward to the new functionality that Jp charras is working on. But let’s say that for now I’m happy enough that the “hack way” of accomplishing it was so trivial.

Cheers,
Cal-linux

The “swap layers” edit window works in this way, that moves all the contents of the layer chosen in the left column (not changeable, just used as list of existing layers) to the layer selected from the drop-down list in the right column.
So the left column is only Labels (source), and to the right you can select the “targets” (destination).
However it does not swap data in the way one could expect by the name (i.e. do the exchange) but it Moves the data from Source layer to Destination layer. So to do true Swap you have to perform two changes (say move In1.Cu to In2.Cu and In2.Cu to In1.Cu, to “Swap” In1.Cu with In2.Cu).

GAAAHH!!! Each cell is a drop-down list !!!

(picture me screaming-in-surprise with the above!!) Like I said, after 24 hours after being pointed to that dialog, I still could not make it work… of course, seeing that each of those cells on the right are a drop-down list, then it is clear how it works… It’s still a bit twisted, the idea of “moving” from layer X to layer Y… bu ok.

So, in light of this new information… revised critique: (ok, as a joke (the joke-but-not-really-a-joke kind), I was going to copy-n-paste exactly the same ranting I posted yesterday :‒) )

Kidding aside: I still think the functionality of the Swap Layers dialog is extremely poor, to the point of making it useless (I guess not after someone has told you, or somehow you have figured out, how it works). There is absolutely zero indication that those are drop-down menus… Even if you click on one of them once, that only highlights the rectangle… You have to click a second time and then you see the drop-down control !!! Completely obscure!

I mean, seriously, after I just read your message telling me that those are drop-down menus, it took me no less than 15 or 20 seconds trying and going “what on earth is fred4u talking about? I’ve seen drop-down menus, and these are not it!” before I finally clicked a second time to discover that they were indeed drop-down menus!

I guess enough with the ranting … After all, it was already said that there is work being done on an improved functionality for this. And I do recognize that this is a rarely-used feature, so…

Cheers!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.