[Resolved] Length of selected track segments

I know there is a similar topic already created, however it does not answer my question.

I would like to know if it is possible to measure the selected track segments, I know that you can measure the entire path of a track and that you can even know the size of a track segment. but the truth is that I don’t know how to measure the distance of a group of selected track segments, do I understand?


here you can see the length of a segment, but if I select 2 or more segments I don’t see anything anymore.

This is extremely important for the adaptation of length per layer, but I don’t have how to do it.

Solution

You can use the RF tools plugin, with this you can measure the length of the selected tracks and make a good adaptation of length per layer

So you are looking for the total length of two or more segments and you do not want to add the individual lengths together?

This is what I see for track properties in 6.0 nightly:

image

1 Like

yes, that’s exactly what I want. thanks, I didn’t know it was in the night version, thanks!

1 Like

Well…my 6.0 nightly version is:

  1. Older than the present 6.0X stable release.
  2. Not directly indicating the length. I would have to do the math.
  3. Showing only the length of one track segment at a time. If I select two segments I get this:

image

This function does not currently exist. It would be pretty easy to implement as a Python plugin though.

I have some vague recollection of a plugin that was kinda ‘Swiss Army Knife’ that had that included. (Makes not to self to start dialog about cleaning up plugin section here :wink: )

In the same way, what you indicate is the width of the track, not the length.

Maybe? @HiGreg

I’m still signed up to get notifications from direct mentions. KiCommand has a ton of unit tests and is geared toward both Python 2 and 3. I haven’t been able to update and test with KiCAD 6, but the current repo should be the latest available. It might require a modification of initialization to conform to latest KiCAD code, but the unit tests will help with integration. The tests are in order and build upon each other, so a linear review of failed tests should be possible to resolve issues effectively, I won’t be able to contribute for another 3-6 months but would be happy to help another contributor on the process.

2 Likes

rf tools

2 Likes

Thanks. I did find this and not sure if it is what the OP is looking for or not.

I still don’t know how to use the python console. with the @maui solution is enough for me

2 Likes

As long as you have a solution. @maui is an active member so that helps a lot. I’m surprised I remembered there was a solution at all. :wink: I don’t need complex solutions so I’ve kinda lost track of everything his program does.

FYI…

You can create a Plugin to do it…

And/or

You can Enter or ‘Paste Plus’ copied code into PCBnew’s Python Console.

Example of Paste Plus: (copy Code below and Paste Plus, Select desired tracks and Press EnterKey. You should see the results. I did Not bother to Sum them for a total length but, you get the idea…

The Code:
import pcbnew
from pcbnew import *
board = pcbnew.GetBoard()
for track in board.GetTracks():
if track.IsSelected():
each = track.GetLength()
print each / 1000000

Results:

2 Likes

Yes I was saying

Specifically I would need to look at the end points and take the square root of ((X2-X1)^2+((Y2-Y1)^2).

Is it compatible with v6 ? (I don’t see it in the content manager) .

Answer: From the link

RF-Tools for KiCAD

compatibility: KiCAD 5.1.x

It is compatible with 6.x … I have updated the code but I forgot the README :laughing:
The code can also calculate the length of arc tracks.
There are some small issues to be refined.

ATM I haven’t had time to package the tools to be handled by the Plugin and Content Manager.
Hoping to be able to package the tool asap.

1 Like

Nice! Thanks a bunch!

For me on Win10, saving the complete folder from github into %userprofile%\Documents\KiCad\6.0\scripting\plugins did the trick.

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