KiCad Move Block to Sheet and Retain Annotations

Share on:

The Problem

Currently, I am working with one of my senior design capstone team members to develop and create the schematic. To get going faster and be sure to give everyone the opportunity to work on the design, we took alternating turns on design and layout. This created a problem for when we wanted to refactor the schematic to make it more clear.

In KiCad 5 and below, one is unable to move an existing schematic block into a sheet without losing all schematic annotations. The copy and paste operation automatically resets all annotations. This is a big problem if you have already done some layout. Because if the annotations do not match the existing layout, the existing layout will be automatically deleted upon netlist import.

To avoid redoing work I had to find a solution.

The Solution

My solution takes advantage of the fact that KiCad's data files are all plain text and a little trickery on my part. Essentially I did a direct schematic import through the Append Schematic Sheet Content... tool, however, this is not straight forward as the hierarchical sheet forms a circular dependency in the parent sheet, and consequently KiCad blocks this operation. To get around that I found that if the path to the child hierarchical sheet was gone or corrupted, the standalone version of Eeschema will let me import the parent into the child. Once this is done, the original (now duplicate) block can be removed in the parent sheet and the child will prevail with the original annotations. See the video below for the process.

With the annotations intact, one is able to fully refactor the schematic without affecting the circuit board layout.

Step by Step

  1. Save a backup, close out of the KiCad project
  2. Open the parent *.sch file in a plain text editor
  3. Find the child *sch file, and append a character to the end, save
  4. Open the child in Eeschema (Standalone)
  5. Move all items far off of the sheet (the parent imports in place)
  6. Append parent, File->Append Schematic Sheet Content...
  7. Delete all blocks that are not desired and recenter schematic
  8. Save and exit
  9. Restore original file path in text editor
  10. Open parent, remove original block
  11. Enjoy!

Going Forward

Interestingly enough, I am not the only one who has been in this situation. On the KiCad forum a question was asked and a bug was created to fix this issue and has been committed. This makes the above guide pointless for those on the nightly 5.99 releases and will be available for all starting with KiCad V6.