You cannot introduce external elements into an svg using the standard command line actions.
The copy command is really - I think designed to be used with the paste-size etc commands.
So you can copy ( or cut ) an object and paste it's size to another object in the same svg.
When you say scripting, if you are python scripting, you can use inkex which is the inkscape extension api written in python without running inkscape.
You can load an svg into it and insert layers from that svg into another svg - without using the Inkscape command line at all.
However all of the size matching is up to you. Also unless you have authored the svgs yourself, be aware that layers, objects very often have dependencies - either on each other -( clones for example ) or in <defs> ( markers / gradients etc )
Thank you for your answer, When I mention scripting it's bash scripting using inkscape action as command line. For Python I am using another standalone lib svgutils. I think I will keep this way then.
Hello,
What I'm trying to achieve :
I have a 3 separates SVG files and I would like to merge them side by side in one SVG file.
I'm using inkscape 1.2.2.
I'm doing all the manipulation using actions in scripts.
In inkscapee action list I can't find any "paste" action.
(So I don't fully understand what is "copy" for)
How can copy some layers from a file to another file ?
Or is they any better way to merge side by side svg files ?
The short answer is no.
You cannot introduce external elements into an svg using the standard command line actions.
The copy command is really - I think designed to be used with the paste-size etc commands.
So you can copy ( or cut ) an object and paste it's size to another object in the same svg.
When you say scripting, if you are python scripting, you can use inkex which is the inkscape extension api written in python without running inkscape.
You can load an svg into it and insert layers from that svg into another svg - without using the Inkscape command line at all.
However all of the size matching is up to you. Also unless you have authored the svgs yourself, be aware that layers, objects very often have dependencies - either on each other -( clones for example ) or in <defs> ( markers / gradients etc )
Thank you for your answer,
When I mention scripting it's bash scripting using inkscape action as command line.
For Python I am using another standalone lib svgutils. I think I will keep this way then.
I'm sharing here if someone as same need/issue
Have a good day.