Changing design rules does not change existing tracks

Help! I’ve layed out a whole board but it turns out I have used the wrong track widths. How can I update all my track widths in one fell swoop without redrawing everything??? I tried modifying the width in the design rules but it doesn’t do anything. Only newly drawn tracks get the new width.

SBW

1 Like

Long way:
select the track tool, set up the desired track width/design rule with the buttons to the top left of the pcbnew window and then hover with the mouse over the track you want to change and hit [E].

Fast way, but needs good script foo:
If ALL tracks should be changed to a single new value you can open the .kicad_pcb file in a text editor and change in the ‘segment’ lines the width option to what you want via search&replace script:

(segment (start 143.875 129.175) (end 142.675 129.175) (width 0.5) (layer F.Cu) (net 1))

I just don’t know if the track-segment thing is the only one in the .kicad_pcb file to use the ‘width’ argument, so be careful and only do this with a backup file at hand :wink:

1 Like

OMG, are you kidding me? They hardcoded the trace widths everywere? You’ve already got the design rule net names at the top!! Why didn’t they just do (width <design_rule_name_here>) and use relative values instead of absolute??? All you’d have to do is refresh the screen after any changes are made to design rules. Guess it’s time to crack open some source code files.

So you want your actual board to change just because you changed a rule? It’s rarely that easy. If I update the design rules to require my tracks to be wider, I’m going to have to reroute them, because suddenly they’re violating each other’s clearances.

Nothing should “automatically” modify a board, unless I very directly tell it to.

3 Likes

Maybe that’s fine for you but I want it to update automatically. It’s a major pain to redraw everything. I don’t see why they can’t just make it a checkbox in the DRC thingy to enforce track thickness based on design rules. If the new track doesn’t fit, then fine, just show an error message and don’t change anything. That way you have both options.

Track segments don’t have to be the same as the netclass value, so I think it is reasonable to encode this explicitly. You can change all tracks to their netclass default with the “Edit All Tracks And Vias” option on right-click menu. Note that if clearance does not allow, the segment width is not changed.

I don’t think the change should be done automatically after changing the netclass default, but perhaps it should prompt to ask if you want to do a global change. The DRC does not check that track segments are same as the netclass default, that would be a useful addition, particularly as the global edit may silently fail to change segment widths.

4 Likes

Well if you did need a real-time autoupdate, you’d have to make two types of tracks: relative and absolute. Relative tracks would just inherit all their properties from the netclass. Absolute tracks are what we have now. A change like that would be doable but I could definitely see it being harder to implement.

However, as a quick and dirty add-on, the DRC option would be a decent compromise. You could make it a drop down list of check boxes that lets you choose which nets to enforce design rules on.

Bobc gave the solution to you your issue.
You can disable DRC and then (with the desired track width) right-click an any track and select “Edit all tracks and vias”. Then select the type of global edition you want to make and it’s set.
If I were you I would check if anything in the wiring gone wrong.
Deppy

Ok, well that works but like bobc said, it fails silently so having it in the DRC section would still be a good idea since you can see exactly where it fails.

Also, I should note for anyone reading this in the future, the “Edit all tracks and vias” option doesn’t show up if you’re using the openGL canvas.

Update: I’m using the nightly build (Version: 5.0.0-rc2-dev-unknown-f73b9a5~65~ubuntu14.04.1, release build), and although “Edit all tracks and vias” does NOT show up in the right-click menu, it DOES show up under the Edit menu (Edit --> “Edit All Tracks And Vias…”) and seems to work well from there!

I’m very happy to have found this feature as it’s very useful.

2 Likes

I ran across this while looking for a solution. Here’s a quick method I figured out.

Under the “Layers Manager” (on the right), go to the “Items” tab and deselect all items except “Tracks”
Take your cursor and drag a rectangle around all the tracks to select all of them. (If in high contrast mode, you will only select the active layer, so if you want all layers, turn this off.)
Press ‘E’ to get the “Track & Via Properties” window.
At the bottom of the window, check the box for “Use net class widths”.
Click ‘OK’ and everything should have changed.

1 Like