Hi, I would like to copy all component in a grasshopper file and paste it into a new grasshopper file.
Now I have already finish the copy part and create new file part. But I can not paste it into new file. I also checked merge method or duplicate method, but they are not available in my case.
Here is the code.
//copy all component to clipboard(successful)
var doc = OnPingDocument();
GH_DocumentIO myIo = new GH_DocumentIO(doc);
myIo.Copy(GH_ClipboardType.System);
//create a new file and show it to canvas(successful)
GH_DocumentServer myServer = Grasshopper.Instances.DocumentServer;
myServer.AddNewDocument();
GH_Document newDoc = myServer.Last();
Grasshopper.Instances.ActiveCanvas.Document = newDoc;
//paste all components from clipboard to new document(Failed)
GH_DocumentIO myIo1 = new GH_DocumentIO(newDoc);
myIo1.Paste(GH_ClipboardType.System);
Any help would be much appreciated.
Thanks