I am running into an issue when trying to copy a schematic while keeping the reference designators the same. The issue is the paste special with the selection “keep existing reference designators the same” is pasting the symbols with the “wrong” reference designator.
Example i have caps C1,C2,C3 and when copied and pasted instead of pasting as C1, C2, C3. I get C1, C1,C1.
Steps to replicate
Open new project
place part in root sheet. i used capacitor C1
create new hierarchical sheet
cut the part C1 and paste it into the new sheet
change the ref des of the part in the new sheet to Cx
copy part and paste special “keeping reference designators the same”
The result will be C1 instead of Cx
This seems to be because an “instance” in the S expression in the kicad .sch file still exists thinking that C1 exists so it looks like this
(reference “C1”) (unit 1)
(reference “C5”) (unit 1)
So it seems C5 exists in my new sheet but also C1 still exists in my root sheet and when i copy and paste it is using C1 instead of C5?
Once i deleted C1 in the root sheet should the instance of it in the root sheet disappear?
I don’t know if this is a bug or it actually is the desirable outcome for the typical use case. i understand i made the mistake and had to cut and paste a symbol from one place to another so but i do feel like once i cut that symbol and paste it elsewhere it should have no reference to the original sheet it was in.
Kicad version if that helps
Application: KiCad Schematic Editor x64 on x64
Version: 7.0.7, release build
libcurl/7.88.1-DEV Schannel zlib/1.2.13
Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW
Date: Aug 14 2023 02:42:39
wxWidgets: 3.2.2 (wchar_t,wx containers)
Compiler: Visual C++ 1936 without C++ ABI
This my first post so just wanted to also say thanks to all the Kicad community for the great software that is Kicad!
standard advice for new forum users: read New Member Information
If you follow the instructions you could promote yourself to the next user level (basic user) and are then allowed to attach multiple pictures + example projects in your threads.
Change Sheet then Copy > Paste Sp. to same Sheet > Result Original Root.
Change Root then Copy > Paste Sp. to Sheet (along side the first Paste Sp. to sheet) > Result First Paste Sp. retains its annotation but new Paste Sp. shows original Root (which no longer exists) instead of changed Root.
@paulvdh I have never had that issue of no RefDes but if in the scenario i explained i delete the initial ref des on the root page and make it C?, then paste it in new sheet, with an auto assigned ref des. once i try to copy and paste that, i get C? . maybe your part also has its first instance as a “C?”
@mf_ibfeew thanks for the tip and showing me the bug report. i kept googling and searching on the forum for stuff related to “keep existing references…” . I guess i should have focused my searching on the “paste special” keyword.
@jmk yeah the issue does seem to come up in many different ways. i dont know all the ways that multiple “instances” of parts in different sheets get into the S expressions in the schematic file. so probably lots of ways to reach this bug
Well thanks for the help everyone. Glad that im not the first person to run into this issue. I am trying to make a bunch of building blocks of schematics that i can copy and paste. so i knew what i was doing might not be the totally typical use case.
I have been struggling with this issue as well for some time now. I copied a block of components from a schematic and pasted it into a text editor to see if I could figure out what was happening. In the text I found references to several components that I have used in other designs but not in the one I was working on. I’m sure I used it successfully in earlier versions but I can’t pinpoint when the change happened. It’s something that really needs to be looked at.