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?
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 )
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.
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. I don’t need complex solutions so I’ve kinda lost track of everything his program does.
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
It is compatible with 6.x … I have updated the code but I forgot the README
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.