File3dm clone / copy / duplicate

What would be the best way to copy a file3dm file using rhino3dm.js? Is there a method for it?@fraguada?

Maybe you could do .toByteArray and then .fromByteArray? I’d need to test that.

1 Like
 let newdoc = rhino.File3dm.fromByteArray(doc.toByteArray())

It does seem to work but it also takes some time to serialize/deserialize every time This might get worse with larger files:

I wonder if there’s a faster, more straightforward way? :thinking:

Why do you want to do this?

I want to copy multiple files with multiple inputs that come from the browser, mainly