SVG Clipboard

Hi there,

I would like to ask if it is possible to export the selected curves as SVG without pop up window, save it on Desktop, copy the file onto clipboard. I intend to copy it in Page Plus. It works well with SVG file.

It would be better to do it without saving the file, because I need to delete it after.

Hi -

Have you tried simply copy-pasting the selected curves straight into Page Plus? Rhino places an SVG version of the selection on the clipboard and a receiving application can use that when you paste. This works fine between Rhino and Inkscape, for example.
-wim

I tried, but it pasted a screenshot of the viewport only. I tried Top view and Perspective view as well.

Hi -

That means that Page Plus doesn’t support reading SVG from the clipboard. Adobe Illustrator doesn’t support that either, while Affinity Designer does. There is a feature request on the list to also place a PDF version of the geometry on the clipboard so that Illustrator could use that but it’s very well possible that this wouldn’t do any good for Page Plus.

That leaves exporting the curves to a temp file on the desktop and then somehow getting that into Page Plus. If you always use the same file name, you probably don’t have to worry too much about having to delete that every time. The following macro can be used to export curves to SVG:

_-Export _Pause "C:\Users\[USERNAME]\Desktop\temp.svg"

… where you have to replace “[USERNAME]” with your user name.
-wim

1 Like

Thank you,

from Rhino 6

import os
import Rhino
import scriptcontext
import rhinoscriptsyntax as rs

rs.Command( "_-Export _Pause c:\\Temp\\temp.svg _Enter")
os.system('cmd /k cd c:\Temp\ && file2clip.exe "temp.svg" && exit')

GitHub - rostok/file2clip: simple command line tool to copy file into windows clipboard

Is it possible to export Fills not just curves?

Hi -

Since you mentioned Rhino 6, I did a quick test and exported a rectangle and solid hatch to SVG. That seems to work fine. Note that these are two different objects in Rhino and will be 2 different objects in the SVG file.
-wim