Copying Portions of Schematic from Another File or Project?

With KiCAD, I often need to copy some portions of schematic from a previous files or projects, and I don’t think I have found a good way of doing it. I’d like to hear from you guys if you have some suggestions

–Joe

2 Likes

Hi

Blocks that I reuse I’ve set up as sheets in a project of their own with files named memorably. It has an ATMega328p with XTAL/decoupling caps as the main sheet. That way if I want to rapidly spin up an ATMega based circuit I can just reuse that whole schematic including additional sheets as my strting point, deleting what I don’t need at the time.

For example the programming headers for ATMega I have in a sheet called prog.sch. It includes the ISP and FTDI headers with nets named. In the new project I (hit S to) create an empty sheet called prog.sch, maybe another called power.sch; save and exit then outside KiCad copy these standard files of the same name over the top. If this new example is ATTiny based I would delete the unwanted FTDI header from prog.sch (and anything else I don’t want) and the ISP header and power supply is good to go.

UI.sch for example includes a header for an I2C display & pull-ups, power and activity LEDs, reset button. Power.sch includes linear 3V3 & 5V regulators with a 2.1mm centre positive DC jack and caps and the PWR_FLAGs. Once they’re copied in, opening the project in KiCad has all these sheets now populated with known working blocks. And I can delete and add from there. In another project I have the power sheet for centre negative DC supplies for guitar pedals etc that has a 9V battery, 5V regulator and battery warning LED. So long as the sheets are named so I can drop them in the system works, though I’m sure once my library of projects expands this could become difficult to manage.

Cheers!
Geoff.

5 Likes

Thanks Geoff. What you shared with us is very systematic and helpful to me.

in the old 4022 this works:
you can copy and paste from an other schematic file:

  • open your target project and schematic.
  • in the schematic editor click the File -Open - find your source and open.
  • select all things you want to copy
  • right click and ‘Save Block’ (or Ctrl + C)
  • File - Recent Files - Open your target.
  • use the ‘Clipboard’ (its a Symbol) or Ctrl + V or the edit menu to past the things.

i dont found a easy way to make these with the current versions…
-> the open command is gone… :frowning:

it is possible to open a second *.sch file if it is in the current project folder by dobble clicking it…
but than the ‘clipboard’ between the two eeschemas is not synced… :expressionless:
(tested with 5338 - December 2014)

i hope there will be some easy ‘copy and paste’ functionality in the future… :wink:

@stryker i like your concept- but till now i did not have used / tried / worked with multiple sheets… i think i have to do this…

additional you can generate a template with the most used things (in my template i have added some voltage and ground symbols and powerflags…)

sunny greetings
stefan

@s_light yeah, I missed the old versions’ copy and paste. I just the latest version 5502, I can use the command “eeschema” to open another sch file, and like you said, the clipboard is not sync’ed.

Recently I started using a workaround like this:

  1. Inside the project I’m working one, create a Hierarchical Sheet name tmp
  2. Go in “tmp” sheet, click on “File -> Append Schematic Sheet” to import the old schematic file. Now the sheets share the clipboard.
  3. After down, go back to the root sheet, and delete the “tmp” hierarchical sheet.

It works but takes more time to do the work.

3 Likes

ok that is a work(around)ing solution… i like it :wink:
i try this the next time i have to import something…

Grrr. so this is really gone and not an oversight… Why? appending schematics just sucks. I’ve been trying to do this for a week getting ready for a KiCAD class that I’m teaching next month (oh I can hear it now, nice tool, but I’ll stick with Eagle). I love the IDEA of a second schematic being open where I can ctrl-C copy from one and ctrl-V (oops still missing) a symbol to the other. This would be an awsim (HP MPL joke) idea, then I could have my entire database in one file with all the attribute fields populated in one enormous hierarchical file. But wait, now I’m confused, when I run eeschem from the command line the Open Schematic is there? Are they not one an the same? Why would it be turn off when running the program manager? I kinda get it, but I really don’t:)

Hi Xcellsior,

if iam understand it right that is the idea:

  1. If you open KiCad and than from the project tool the Schematic editor it* is not there.
  2. If you open EEschema stand alone it* is there.
    it* = Filemenu -> new / open / open last used

the difference is so you can’t get into problems with the project syncing between eeschema and pcbnew i think…

best thing would be to change the copy and paste behaviour to just use the systems clipboard…
but i don’t know how difficult it is to do this for all possible operating systems.
on past it would be good to have a option to clear or use the clipboard content annotation and original position on the page… (something like Ctrl+V = paste - hang on the cursor for placing; Ctrl + Shift + V = past on original place; and defaults to clear annotation and with modifier Alt pushed use original annotation)

sunny greetings
stefan

A hard way:

I did it like this with Kicad-4.0.2-stable (MacOSX)

  1. create a blank hierarchical sheet in current schematic
  2. enter into the sheet
  3. append the schematic which you want to copy from
  4. copy
    4.1 select the block you want to copy
    4.2 Command + C to copy the block (if succeeded, a PASTE icon is highlighted in toolbar)
  5. leave the hierarchical sheet back to the schematic you want to copy to
  6. click the PASTE icon in the toolbar
  7. delete the hierarchical sheet
2 Likes

sprhawk’s method, works fine for me, it’s not bad.

There needs to be a better way to do this though, it’s a bit silly.

1 Like

This has always been a pain. I don’t know much about how the Windows clipboard or other OS’s “native” copy/paste commands are accessed from the code, but it is such a fundamental part of the normal Windows interface that it really stands out when it is missing. It would be at or near the top of the list of things I would vote for as an enhancement.

1 Like

It’s one of the major points why they’re working on EEschema to make this possible (afaik)…
http://ci.kicad.org/job/kicad-doxygen/ws/Documentation/doxygen/html/v5_road_map.html

1 Like

My workaround:
-Drag “yourSchematic”.sch from one project to another.
(At this point it will not show up in your kicad project)
-In new project create a new hierarchical sheet with the same name as the other sheet.
(A file named ‘yourSchematic.sch’ already exists. Do you want to create a sheet with the contents of this file?)
-Click yes
-Link up your libraries
(also still not showing up in my kicad project viewer)

Patrick

1 Like

I’ve found another workaround (I’m on KiCad 4.0.5 on Mac OS). eeschema has an option in the File menu, “Append Schematic”. It lets you select another Schematic (.sch file) from disk, and it basically pastes it right on top of your current work. So if I know I need to paste from another schematic before I start drawing the new one, I’ll just Append the source and block-delete everything I don’t need. If I’ve already got some components laid out, I’ll zoom way out, drag everything outside the page boundaries (the canvas is much bigger than the bounded area), Append, block-delete, and then drag everything back into the layout box.

This does seem to append page layout stuff like Title, Company, etc, so you may need to check that after appending.

1 Like

The question is why does the ctrl+C command works and not the ctrl+V command.

D.

1 Like

Tested on 4.0.7 MacOS
1 - Drag box around components to copy
2 - right click > copy block
3 - move mouse and click to place

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