Article 006- Adding new commands to KiCad's PCB Editor
- Details
- Published: Wednesday, 22 July 2026
- Hits: 56
Adding new commands to KiCad's PCB Editor
As a long-time AutoCAD user, I often find working with other CAD packages frustrating. AutoCAD has been refined over several decades by Autodesk, resulting in an extremely efficient and intuitive workflow that experienced users quickly become accustomed to. It is not simply a matter of unfamiliarity with KiCad's commands; rather, coming from an AutoCAD background, some aspects of KiCad's workflow can be surprisingly cumbersome and inefficient.
While using KiCad for PCB design, I frequently found myself missing certain AutoCAD-style commands and workflows. To be fair, KiCad often provides equivalent functionality, but it is not always implemented in the same way, nor is it always as efficient or intuitive for users accustomed to AutoCAD.
With that in mind, I downloaded the latest KiCad source code and successfully imported the project into Visual Studio 2022, allowing me to explore and modify the C++ codebase directly.
This article will evolve as the project progresses. My intention is not only to implement improvements that benefit my own workflow, but also to investigate the process of submitting suitable enhancements to the KiCad development team for consideration in future releases. In the meantime my updates are on my GitHub - https://github.com/Ian-Johnston/KiCad-modifications
Getting the source code installed in Visual Studio 2022:
This involved considerably more than simply opening the source code. As KiCad is a large C++ application that uses CMake and a substantial number of third-party libraries, the process began by downloading the source code, opening the root folder directly in Visual Studio's CMake environment, and configuring the build system.
A separate vcpkg package manager installation was required to automatically download and build over a hundred dependencies, including wxWidgets, Boost, OpenCascade and numerous supporting libraries.
Several issues had to be resolved along the way, including modifying the CMake preset configuration and diagnosing a build failure caused by an obsolete tar.exe from an Atmel development package being incorrectly detected and cached by CMake.
Once these issues were resolved, KiCad successfully configured, compiled and linked, producing a working debug build that could be launched directly from the generated installation directory. The entire process provided a fully functional Visual Studio development environment suitable for debugging and modifying the KiCad source code.
After Visual Studio/Ninja has compiled all the source code and created the executables and DLLs in the build tree, this command which copies all of the required runtime files into a structured installation directory:
"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --install build\msvc-win64-debug
This includes the KiCad executables, internal DLLs, plugins, scripting files, libraries, icons, translations and other runtime resources. This has tto be run after every build in VS2022.
AutoCad style commands
MATCHPROP
Copies properties from one entity to other similar entities, such as tracks to tracks or vias to vias.
The user selects a source track or via, invokes the command using SHIFT+Q, and then simply clicks on target tracks or vias one after another. The selected properties are immediately applied to each target entity. The command remains active until ESC is pressed. Also supports drag selecting a bunch of tracks or vias.
MATCHPROP is also available from the right-click context menu when a supported entity is selected.
Preliminary video:
MOVEFROM
The user selects one or more items, invokes the command, picks any reference point on the selection, then picks a destination point. The selection is moved such that the chosen reference point lands exactly on the destination point.
COPYFROM
The user selects one or more items, invokes the command, picks any reference point on the selection, then picks a destination point. A copy of the selection is created with the chosen reference point landing exactly on the destination point. The command remains active until ESC is pressed.
OFFSET
The user selects a line, arc, board outline or graphic object, invokes the command, enters an offset distance and then clicks the side to offset. A new parallel object is created at the specified distance.
TRIM
The user selects a cutting edge, invokes the command, then clicks lines, arcs or board outline segments. The selected objects are trimmed back to the cutting edge.
EXTEND
The user selects a boundary edge, invokes the command, then clicks lines, arcs or board outline segments. The selected objects are extended until they meet the boundary edge.
BREAK
The user selects a line, track or arc, invokes the command and then picks two points. The section between the two points is removed.
JOIN
The user selects two or more connected lines, arcs or tracks and invokes the command. The selected geometry is merged into a continuous object where possible.
STRETCH
The user selects geometry using a crossing window, invokes the command and drags a reference point. Only vertices within the crossing selection move while connected geometry stretches to maintain continuity.
ALIGN
The user selects multiple objects, invokes the command and chooses Left, Right, Top, Bottom, Centre Horizontal or Centre Vertical. The selected objects are aligned accordingly.

