Add New Schematic Sheet Keep Ref Des

I think I’m missing something obvious. I have two schematic sheets I need to combine into one project. They already have been annotated (these schematics are of an existing board, so I can’t change the ref des). No matter how I try it, they get reset.

I’ve tried making an empty hierarchical sheet link to an existing schematic file, no joy. Appending the schematic has the same effect, everything is reset. I tried it both via KiCad, and directly in EESchema, same results.

These two schematics all use the exact same parts library.

Any idea how to accomplish this?

My version is:

Application: kicad
Version: (5.1.2-1)-1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Platform: Mac OS X (Darwin 18.6.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (UTF-8,STL containers,compatible with 2.8)
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.54.0
    Compiler: Clang 9.0.0 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=ON
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

This has worked in the past and works in nightly builds. Copy an old .sch file to a new project with a file manager. Create a new hierarchical sheet in the new project so that you change the file name to point to the old file. That’s it. The annotations are there intact.

Well, I had already tried that. But based on your comment, I did it again to double-check, and indeed the ref des were all reset. Actually, the first time they are not only reset, but all the symbols are crazy. See the image in this user’s post to get an idea of what I’m talking about:

But, save that weird file and re-open it again, it looks normal - symbols are back, but the ref des are still all reset.

However, a little more playing with it, and I discovered the secret. Don’t add a page an point to an existing sheet. Add a page that is blank, close the program, and replace the blank file with your desired file. That does the trick. Now I can add a page that has already been annotated without losing all the annotations.

Not sure if this is the intended behavior or not, but at least I got it working.
Thanks.

To summarize, this is correct, but you have to do it in the opposite order. That is,

  • Create a new hierarchical sheet in the new project
  • [Close the project (may not be necessary?]
  • Copy an old .sch file to a new project with a file manager using the same name as the new sheet just added, overwriting it
1 Like

No, when you create a sheet it opens a properties dialog which lets you change the file (or the name). Both orders work. I tried before I wrote.

  1. Copy an old .sch file to the new project with a file manager.
  2. Draw a hierarchical sheet box to the schematic of the new project.
  3. It opens a dialog. Copy the old schematic file name there to the File name field.
  4. It opens a confirmation dialog. Accept.
    There it is, the reference designators are intact.

The ?? boxes are there because the new project doesn’t point to the same symbol libraries. See some FAQ articles about library management. You have to have the same libraries in the symbol library tables (global and local).

Interesting. I’ll give that a try tomorrow (on the road now). To the best of my knowledge I am only using one library, the same one, in both projects, but I may be wrong and that might be the cause of my problem.

I can say with 100% certainty that when you get all those big question marks in boxes, the annotations are lost. Reopening the file corrects the symbols but not the annotations

Check also some symbol with a ?? box and see from what library it is. It might also be possible that it for example uses the resque library of the old project even if you originally didn’t add that library there manually.

Again, no joy. I confirmed no rescue parts. I unchecked all the normal KiCad libraries, so only my local project library was active. The same behavior - adding a hierarchy sheet to an empty root level schematic, and specifying “link to the existing file” completely wipes out all annotation, and also it temporarily wipes out all symbols. Closing and reopening the schematic file brings back the symbols, not the annotation.

BUT… I discovered something helpful. The sheet I was trying to bring in was called orig.sch. After adding it to the new project, there was a backup orig.bak file created. This backup file DOES have the annotations intact. So all I need to do is close the project which I just added the sheet, delete orig.sch and rename the backup. Now the new project has the new sheet, annotated as I wanted.

-Chris

By the way, the process of unchecking all active libraries was a pain. There’s no “select all” option, so I had to manually click each one out of several dozen. And while I could highlight a group of libraries, I couldn’t figure out how to mass-click them. I also discovered, with a big groan, that this setting is KiCad-wide, and not just the test project I made. Now I have to go click them all back on again. Grrrrrr.

Yes this is normally the case. But there is also a bug in current stable. For some reasons you need to restart eeschema after integrating an already existing subsheet. (You seem to be a nightly user. Remember to always test your assumptions in the current stable release before giving such precise advice here.)

Did you try it in stable? Because i can replicate the problem experienced by @thestumbler and the only way around this is indeed by using the order described in their workaround.

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