Copying Portions of Schematic from Another File or Project?

Slight difference on Win10 and Version: (5.0.0-rc2-dev-44-gde6b32d23), release build

Drag box selects items, immediate applied default is place(move) (but image suggests duplicate, as two copies display, until screen redraws eg on zoom, a minor wrinkle)

Right click has choices of Place/Cut/Copy/Drag/Duplicate/Delete

Duplicate sightly differs from Copy, in that Duplicate is live, and Copy is ‘to clipboard’, which means you can switch sheets and paste later.

Seems good, but I do spot one bug - in Copy/Duplicate of a resistor network, the unit-number is dropped, and all selections become unit A.
Could be an artifact of the moronic R?A empty field default, whereby no attempt is made to tag ‘next available RefDes’ (aka auto-increment), a simple and very useful feature found in many/most? other tool chains.

Such discard of all information on copy, means a lot of manual checking/mouse moves and clicks to actually finish any copy. Auto-annotate tools will fail, if the unit number is lost.

I’m late to this discussion but I’ve just been trying to do this as well. I ended up using the hierarchical sheet method to append an existing schematic and then copied across the bits I needed. Perhaps what is needed is a way to save schematic blocks to a block library - I do a lot of design work with the same microcontrollers and always have the same power supplies, crystal sub systems and reset circuits (Usually with the same PCB components as well). Having a way of saving these schematic elements as blocks and then adding them like you would add a symbol would be great.

2 Likes

Dec. 26, 2018

Tonight I read your suggestions before copying a schematic I created last week in order to replace one component with another.

But I haven’t yet figured out what blocks are. So I decided to try an easier way first to see if that might work.

My goal was to replace the PNP 2N3906 in
the PCB w/ A TIP120 Darlington PNP in order to drive 700 mA instead of 300 mA, leaving everything else in the schematic unchanged. But the bigger transistor had a different footprint and handled a larger collector current.

So I tried copying & saving a schematic, in the same way you would copy and paste text between two files, and it worked! YAY!

Here’s how I did it:
Created new project called CCS_700 & in a new child folder with that name, in the parent folder where my source project was.
Navigated to the previous project in kicad. I right clicked on schematic file & opened it w/ a text editor.
Copied everything from that source schematic file. (Ctrl-A, Ctrl-C)
Renavigated to the new directory in the new folder CCS_700 in kicad.
Right clicked on schematic file & opened it w/ a text editor
Deleted its 4 lines.
Pasted the contents of the previous schematic file that I had copied. (Ctrl - V).
Saved the schematic file.
Shut & restarted kicad.
YAY ! It worked! A complete duplicate of the source cct.

I then changed the component I wanted to, reassigned it a footprint, built my netlist, and laid out the new PCB to handle larger current.

1 Like

I was having trouble copy+paste blocks in eeschema as well, so i found this thread.
Finally i figured out what was the problem:
You can not copy+paste between projects, if you open eeschema from inside the project manager, try to copy, and later try to paste using a different project, the clipboard will be empty.

What you CAN do: Open the STANDALONE eeschema, and open your .sch file manually, copy the block, open the destination .sch, and paste.
It will WORK!

Tried under linux (debian), V5.0.2+dfsg1-1 release

2 Likes

Thanks nor, this helped a lot.
You are right, file open is only available in standalone eeschema.
Win7, KiCad 5.1.0

Thanks for your approach, it seemed to work her at first, only the copied block referenced the <old_project>-rescue.lib . Re-assigning the comonents is not a huge deal, but maybe I’m missing something and this shouldn’t happen?

Are you sure this works from one project to another, not just within a schema?

Well if your old project relied on the rescue lib then your schematic is no longer really reusable. That is just how it is.

You have two options:

  • Fix the references and point them to the current equivalent symbol in the normal libraries.
  • temporarily add the old rescue lib to the project local libraries. Save the schematic. Remove the old rescue lib. Start the rescue dialog to get the old symbols into the rescue lib of the current project.

This all will go away with the new file format that is expected to be part of v6. (So about two years from now.)

OK, thanks Rene! Another important lesson learned!

Having said that, there is a rescue-lib in every project folder. So I would have to grep all the .sch files and check if it contains the *-rescue link? Just did that with one schematics file and it reported 49 cases (in 1533 lines).

Do not use kicad external tools to fix this if you do not fully understand the file format!

If you want to go with option 1 then use the library link editor which is found in the tools menu. I explain that in detail as part of Converting KiCad version 4 projects to version 5 (Remap a project)

If you want to go with option 2 then you really do not need to care how many symbols are used but only how many rescue libs are used.

  • Step one of adding the old rescue lib to the current projects list of libs and saving the schematic will copy all used assets into the cache library.
  • Step 2 of removing said rescue lib from the list of libs and starting the rescue dialog will create a new rescue lib in your current project where the symbols that now only existed in the cache lib will be copied.

OK, thanks for the detailed instructions, Rene!

Hi Team
has there been any improvement to the above issue or are we still stuck with the workarounds?

I’m using version 5.1.6

Thanks Team

Whatever was said for any 5.1.x version (and probably 5.0) is still true (I’m not going through the posts to see what was said). The unstable development version 5.99 a.k.a nightly builds is different. Copypaste should work normally between windows, and there’s no cache file.

Here is how I did it (KiCad 5.1.9) but the method is so raw it should work everywhere.

My project is a stereo amplifier requiring (+24)V - 0 - (-24)V supply and a 5V supply rails. Initially, I had the supplies as hierarchical sheets in my schematic. I had the footprint association done.

Put simply in my project, I had 1 root sheet (amp) and 2 hierarchical sheets (power supplies). I had to merge those two sheets into one. So usual block-select, copy, paste. I then deleted one hierarchical sheet.

Now I have 1 root sheet (amp) and 1 hierarchical sheet (both supplies).

I opened the schematic file in a text editor and found the file name of my hierarchical sheet (this can be done inside the sheet as well).

Now I created a new project. Opened its .sch file in a text editor and copy-pasted the contents from the sheet above into this blank one.

When I opened the file in kicad schematic editor, I had to go through the annotation step. But all footprint association were retained afterwards.

Put simply, I had to convert all hierarchical sheets into one in the original project and then copied the text contents into the blank schematic file of the new.

1 Like

Thanks JoeChen,

that is an easy work around.

On KiCAD 6.0.0 just copy and paste among projects. This step is definitely solved

3 Likes

For those using KiCAD 5.x because it has some advantages over 6.0 (doesnt break old-OS compatibility for those without deep pockets, and no annoying CRT-effect fade out dialog boxes), you can still have the luxury of pulling out your hair copying between projects :slight_smile: Heres the steps I did that seem to finally work (schem and layout):

(note: Eagle can do this in 2-3 clicks):

  1. close current (new) project completely
  2. open ONLY kicad_pcb file
  3. when open in standalone mode, you can do File > Append (the new secret option appears) and select target layout to add
  4. open full main project now (layout is added, now we need to add reference / schematic)
  5. in schem, go Place > Heigharchical sheet
  6. “draw” the sheet to make it (doesnt matter new sheet name)
  7. Use symbols at top to select the new sheet
  8. in the new sheet Append > Append Schematic Sheet Content
  9. dont change references, you have to do that for new project (keep old part refs the same!)
  10. go to main (not copied) sheet. Annotate > and select:

“Use current page only”
“reset existing annotations”
“First free after X1000”

(if chosing X100 wont work, cause power flags use those.)

  1. got to PCB Layout > Update PCB from schem
  2. select “Re-associate footprints by reference”
  3. should work now, if you are still alive XD

Just tried with KiCAD 7.0:

  • opened the project as usual and schematic1
  • opened only the schematic2 from an older project
  • copied parts from schematic2 to schematic1 with ^C → ^V (copy-paste)

Welcome @prrts , and yes,

there have been huge changes within Kicad of recent times and old posts like this are often irrelevant to the current versions.

Time to close this thread, but please feel free to contribute to more current topics :slightly_smiling_face: