Copy parts of schematic

Hi,
I have a piece of schematic that I use a lot, can I copy a that portion and then paste it into a new project please ?

Hello!
I remember that in 5.x, it’s not obvious, and I think I made this using hierarchical sheets. You get one circuit part into one file, so if you copy this file into your project (also hierarchical), then there is a way to reuse circuits.
Now in 5.99 (I have just tried).

  • If you open the project you want to copy from, copy the part, close the project, open the new one, then it doesn’t work.
  • If you open both projects in parallel, then you can copy and paste like in any other program, by ctrl-c and ctrl-v.

You can create a new subframe in the new project, reference the old one, double-click it to enter the sub-diagram, copy the content you want, and then leave the sub-diagram to paste in the new project. Finally, you can delete the unnecessary subframe.

Thanks but I dont no how to use nightly’s and it dosent work on the latest stable version

Andy

Either of those should work. Try pasting into a text editor after closing the source project (you should get something that looks like a fragment of a .kicad_sch file).

Anyway, if it’s reproducible it probably warrants a bug…

Yes I thought we fixed the first problem already in https://gitlab.com/kicad/code/kicad/-/commit/ae009e075868c9ecdbf76eac7b4b7abf03ae9c10 (we weren’t flushing the clipboard)

It should be fixed but there might be a missing edge case or a regression.

Hello!

Thanks but I dont no how to use nightly’s and it dosent work on the latest stable version

Yes, that’s why I suggested a solution for 5.1, that I was using in the past, and which consists in exploiting the hierarchical features.

Hello!

I retried this morning like this (See hereafter for version info).
What I did:

  • Open one project
  • Open the schematic
  • Click and drag to select a bunch of components with their wiring.
  • Ctrl-C to copy.
  • Ctrl-V to paste it, just to verify that it has been copied -> OK Just in case, paste another time
    to verify that the buffer is not emptied when pasting. -> OK
  • Verify in a text file that paste works -> Yes.
  • Close schematic and project.
  • Verify in the text file that paste still works
    **** It doesn’t
  • Open another project and its schematic
  • Ctrl-V in the new schematic.
    **** Nothing happens.

Application: KiCad
Version: 5.99.0-unknown-4317848cfe~131~ubuntu21.04.1, release build
Libraries:
wxWidgets 3.0.5
libcurl/7.74.0 OpenSSL/1.1.1j zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh/0.9.5/openssl/zlib nghttp2/1.43.0 librtmp/2.3

Platform: Linux 5.11.0-22-generic x86_64, 64 bit, Little endian, wxGTK, ubuntu, wayland

Build Info:
Date: Jul 19 2021 19:21:39
wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.74.0
OCC: 7.5.1
Curl: 7.74.0
ngspice: 34
Compiler: GCC 10.3.0 with C++ ABI 1014

Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON

I just tested and it works on Windows. I don’t use linux so there may be some wxwidgets quirk or some specifics in linux that also need to happen to get this to work.

Would you kind opening a bug report on gitlab so we can keep track of the issue?

I wonder if this is the same bug as the one that mentions the Linux “primary clipboard”. I’ve never understood what that was, so I’m not sure…

We should probably have this discussion on Gitlab instead. I’ve created an issue: https://gitlab.com/kicad/code/kicad/-/issues/8826

@roboya It would be good if you could try building against wxWidgets 3.1 instead of 3.0 as 3.0 doesn’t support flushing the clipboard om GTK - see https://docs.wxwidgets.org/3.0/classwx_clipboard.html#a10997196ffd3b2cf8d823033f291f932

Separately, it appears wxWidgets 3.1 implementation doesnt work if the clipboard is using primary selection (https://docs.wxwidgets.org/3.1/classwx_clipboard.html#a10997196ffd3b2cf8d823033f291f932)

“Primary” is not the regular clipboard.

In Linux there generally are (at least) two different ways to copy & paste.
There is the regular with [Ctrl + c] & [Ctrl + v], but there is also a quicker and often more convenient way.

It works by first making some kind of selection, for example by dragging the mouse over text while pressing the Left Mouse button.
At the moment the text is highlighted, it is already selected. No need to put it on the clipboard.

If you then press the middle mouse button in some other text editor / input field / etc. then the highlighted text is copied there.

So the whole action is:

  1. Highlight text.
  2. Press Middle Mouse Button in some other location.

Apparently this is called “primary”. The two buffers are independent from each other. The “primary” buffer is very volatile though. As soon as the text is un-selected, it’s removed from that buffer.

2 Likes

Hello!

@roboya It would be good if you could try building against wxWidgets 3.1 instead of 3.0 as 3.0 doesn’t support flushing the clipboard om GTK - see …

Sorry, I will leave this job to people who know how to do, otherwise I will likely spend a week on it if not more. But no problem to test it if somebody uploads a new version.

I might have missed it mentioned above, but somebody on this forum mentioned a way which works for me on Windows. See here Copying part of a schematic

Blockquote Open the STANDALONE eeschema, and open your .sch file manually, copy the block, open the destination (from within Eeschema, not separately) .sch, and paste.

By “Nor”, March 2019

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