MoI discussion forum
MoI discussion forum

Full Version: Copy-paste from Rhino 7 to MoI3d

Show messages:  1-4  5-24  25-44  45-51

From: Michael Gibson
13 Dec 2020   [#5] In reply to [#4]
Hi mdesign,

re:
> Will it be possible to copy-paste between newest MoI and newest Rhino 7?

I don't know, it's up to the current Rhino developers to decide if they want to support copy and paste to other apps and to older versions of Rhino.

- Michael
From: Viewbyte
22 Dec 2020   [#6]
Greetings all,
Now that Rhino 7 is officially available to buy, I'm just wondering if there is a definitive answer to the question of Rhino-to-MOI copy / paste?
From: Michael Gibson
22 Dec 2020   [#7] In reply to [#6]
Hi Viewbyte,

> Greetings all,
> Now that Rhino 7 is officially available to buy, I'm just wondering if there is a definitive answer
> to the question of Rhino-to-MOI copy / paste?

Not that I'm aware of myself. But if you cannot copy/paste from Rhino 7 to Rhino 5 or Rhino 6 either then it won't work with MoI as well.

I might be able to cook up a utility program to help though, I'll look into it when the MoI v4 release wraps up.

- Michael
From: renklint
22 Dec 2020   [#8] In reply to [#6]
It is possible to copy paste from rhino 7 to rhino 6.
From: Michael Gibson
22 Dec 2020   [#9] In reply to [#8]
Hi renklint,

re:
> It is possible to copy paste from rhino 7 to rhino 6.

What about from Rhino 7 to Rhino 5, does that work?

- Michael
From: renklint
24 Dec 2020   [#10] In reply to [#9]
Sorry, I haven't got version 5.

Today I purchased Moi3d and have downloaded v4 beta.

I can kinda copy/paste curves from Rhino 7 to Moi v4.

But if the curves are 3d they are squished to flat on z.

Pasted a SubD and a Nurbs closed surface from Rhino 7, which came out as flat curves in Moi.
Then pasted to Rhino 6, copied and pasted both in Moi. Only the polysurface was pasted in Moi.

Image Attachments:
paste.png 


From: Michael Gibson
24 Dec 2020   [#11] In reply to [#10]
Hi renklint, probably what's happening is that it's the PDF clipboard format being used rather than 3DM format.

The problem is likely that Rhino v7 is not telling the OS clipboard system that it can produce a Rhino v5 3DM format for the clipboard data. That's what MoI would need to see in the clipboard for it to work.

What operating system are you running on? I can probably cook up a helper app that could make things work by translating Rhino v7 3DM format on the clipboard into Rhino v5 format, then you'd modify the paste function to run the helper app right before doing the paste.

I probably need to collect a little bit of information first like get the names of the clipboard formats that Rhino v7 is putting on the clipboard.

- Michael
From: renklint
24 Dec 2020   [#12] In reply to [#11]
I'm using win 10.

Please let me know if I can help you doing some tests.

The free clipboard viewer has this to report about the copied geometry.
(https://freeclipboardviewer.com/windowsclipboard/)

Attachments:
copy.cl7

Image Attachments:
clip.png 


From: Michael Gibson
24 Dec 2020   [#13] In reply to [#10]
Hi renklint,

re:
> Then pasted to Rhino 6, copied and pasted both in Moi. Only the polysurface was pasted in Moi.

That's to be expected - SubD is a new object type in Rhino v6 and v7 and isn't stored in Rhino v5 format 3DM files which is currently the latest type that MoI can read.

I think there's some method to convert a SubD Rhino object into a regular NURBS object, you would need to do that to transfer it into MoI.

- Michael
From: Michael Gibson
24 Dec 2020   [#14] In reply to [#12]
Hi renklint,

re:
> I'm using win 10.
>
> Please let me know if I can help you doing some tests.

Well the first step is to use a clipboard viewer utility to see what clipboard data types Rhino v7 is putting in the clipboard when you do a copy from Rhino.

It seems that there isn't a clipboard viewer built in to Windows anymore like there used to be.

If you can try some app like the ones mentioned here:
https://www.thewindowsclub.com/windows-clipboard-manager-viewer

the data that I'm looking for is a list of clipboard formats like it should have a list something like "CF_DIB", "PDF", "Rhino v7 3DM clip", etc...

I can cook up a little app that would gather and show this list if none of those viewers seems to do it well.

- Michael
From: renklint
24 Dec 2020   [#15] In reply to [#14]
Here's a list:

Image Attachments:
clip2.png 


From: Michael Gibson
26 Dec 2020   [#16] In reply to [#15]
Hi renklint,

re:
> Here's a list:

Thanks, that helps! I've got a helper app almost ready which I think should make it possible to solve this. It's a small program that is built with the OpenNURBS7 library and so it can look in the system clipboard and if a Rhino v7 3DM file is in there it can take it and convert it to a Rhino v5 3DM file and put that in the clipboard so that the paste will work.

Then you would modify your Ctrl+V paste keyboard shortcut so it runs this helper app before doing the actual paste into MoI.

I've almost got it ready to test.

What happens if you do a Ctrl+C copy in Moi and then try to paste in Rhino v7, does that work or is that direction also not working with Rhino v7 either?

- Michael
From: renklint
26 Dec 2020   [#17] In reply to [#16]
That sounds very promising.
From Moi to Rhino 7 works.
From: Michael Gibson
26 Dec 2020   [#18] In reply to [#17]
Hi renklint, I've attached the helper app here. Unzip it and save it somewhere.

Then you'll need to modify the Ctrl+V shortcut key in MoI to run the helper app before doing the paste.

To do that go to Options > Shortcut Keys and for the Ctrl+V key that currently has "Paste" for its Command value, instead put in this:

script: moi.filesystem.shellExecute( 'c:\\path\\UpdateRhinoClipboard.exe', 'target=moi', true /*wait for finish*/ ); moi.command.execCommand( 'paste' );

You'll need to update the c:\\path\\ to the path where you saved it, and also note that instead of just one \ character you need 2 of them like \\ because a single \ is an escape character in JavaScript.

Any luck with Ctrl+V working from Rhino 7 to Moi with that in place?

- Michael

UPDATE - Mac version is here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=9890.35

Rhino script for going the reverse direction here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=9890.40

Attachments:
UpdateRhinoClipboard.zip


From: renklint
26 Dec 2020   [#19] In reply to [#18]
Yes!
Points, curves, open surfaces and polysurfaces - from Rhino 7 to Moi.
You are a wizard!


Image Attachments:
rhino.png 


From: Michael Gibson
27 Dec 2020   [#20] In reply to [#19]
Hi renklint, that's great I'm glad that works!

- Michael
From: feirui445
31 Dec 2020   [#21] In reply to [#18]
Hi Michael Gibson,I don't know how to save and set the folder. Can you demonstrate it? Thank you
From: Michael Gibson
31 Dec 2020   [#22] In reply to [#21]
Hi feirui445, the folder can be anywhere on your system where it is convenient for you to store a downloaded file.

One possibility would be to store it in the MoI appdata folder. To do that press Win+R to open the Windows "Run" dialog and put in: %AppData%\Moi and push Enter. That will open up the MoI appdata folder where some MoI files are already stored. It will be a path like: C:\Users\Michael\AppData\Roaming\Moi

Unzip the file attached above to get the UpdateRhinoClipboard.exe helper program and put it in that appdata folder.

Then you would set your Ctrl+V shortcut in MoI (under Options > Shortcut keys) to be (copy and paste the following into the "Command" part of the shortcut key):

script: moi.filesystem.shellExecute( 'C:\\Users\\Michael\\AppData\\Roaming\\Moi\\UpdateRhinoClipboard.exe', 'target=moi', true /*wait for finish*/ ); moi.command.execCommand( 'paste' );

Note - you would replace the "Michael" in the path with your user name. One thing to note is the path name in the script code needs doubled backslash characters. Instead of just one \ as the path separator it needs 2 like \\. That's because in JavaScript a single \ is an escape character for special characters like \t means tab or \n means newline. The \\ means make a single backslash in the actual string.

- Michael
From: feirui445
31 Dec 2020   [#23] In reply to [#22]
Hi Michael, I'll select a face of the object in rhinoceros 7 to copy, and then paste it in moi3d, and the object will appear. Copy all the objects in rhinoceros 7, and then paste them in moi3d. The objects are lines. I'll try again, thank you!
From: Michael Gibson
31 Dec 2020   [#24] In reply to [#23]
Hi feirui445, if the objects are all lines flattened down on the X/Y plane then it means that PDF format is being used and the clipboard updater is not running.

When you paste into MoI how are you doing it exactly, are you using the Ctrl+V keyboard shortcut or some other method?

- Michael

Show messages:  1-4  5-24  25-44  45-51