MoI discussion forum
MoI discussion forum

Full Version: Copy-paste from Rhino 7 to MoI3d

Show messages:  1-6  7-26  27-46  47-51

From: BurrMan
31 Dec 2020   [#27] In reply to [#26]
So the function in that case would be to run this script, which alters clipboard data, THEN Ctrl-V to paste into MoI?
From: Michael Gibson
31 Dec 2020   [#28] In reply to [#27]
Hi Burr, yes that's correct. Although you would remove the end part of the script above (moi.command.execCommand( 'paste' ) ) if you wanted to do the paste separately.

When the UpdateRhinoClipboard.exe program is run, it will look in the system clipboard and if it finds Rhino v7 (or v6) 3DM data there but no Rhino v5 data it will generate the Rhino v5 format from the v7 data and put it in the clipboard. Once that has been done then pasting into MoI will work.

At some point I'll probably be able to update the OpenNURBS library used directly by MoI to v7. There has been a lot of changes in it though so it will need some careful work to make sure nothing that MoI relies on itself gets broken during the update. And since compatibility is being broken on every version release it's kind of a never ending thing that I'm getting tired of chasing.

- Michael
From: BurrMan
1 Jan 2021   [#29] In reply to [#28]
Hi Michael,
Thanks for the help, i'm pretty sure it's sorted. Again i was confused.

I didn't read the "it looks for v7" part. I was using v6. Just wanted to test if i had it installed and working correctly. I most likely won't be moving to v7. It was a "Just in case" installation...

The helper app may be a good way to handle it going forward, (hopefully that was easier to cook up) so you don't have to mess with the base much... may not be enough guys using the copy/paste functionality to warrant the work...

Thanks again. Sorry about the extra work from my end...
From: Michael Gibson
1 Jan 2021   [#30] In reply to [#29]
Hi Burr, yes a standalone utility like this is definitely easier to cook up than updating the library built in to MoI.

- Michael
From: shane (SHANE_W)
5 Jan 2021   [#31]
Hi Michael, any chance we could have a similar option for Mac users?

Thanks,
From: Michael Gibson
5 Jan 2021   [#32] In reply to [#31]
Hi Shane,

re:
> Hi Michael, any chance we could have a similar option for Mac users?

Yes I should be able to make a Mac version as well.

Is the Mac Rhino 7 working for copy/paste from MoI into Rhino like the Rhino 7 Windows version? Or is it not working in both directions?

- Michael
From: shane (SHANE_W)
5 Jan 2021   [#33] In reply to [#32]
Hi Michael, it will not work in either direction for me.

Thanks,
From: feirui445
6 Jan 2021   [#34] In reply to [#16]
I found that one step can be successful:

1. Select the overall model in rhino v7 and press Ctrl + C

2. Select one face of the model in rhino v7 and press Ctrl + C

3. Back to moi3d and press Ctrl + V,Ctrl + V, the model in rhino v7 will be copied

It's a little cumbersome

Note: the subdivision model in rhino v7 needs to be converted to Nurbs model, which can be copied
From: Michael Gibson
6 Jan 2021   [#35] In reply to [#33]
Hi Shane, a Mac version of the clipboard helper app is attached here.

The way it should work is to unzip it somewhere on your system, if you want to put it with some other MoI files you could put it in the moi appdata directory which is:
/Users/<your username>/Library/Application Support/Moi (note Library folder is hidden by default).

Then to enable copy/paste from Rhino v7 into MoI, modify the Cmd+V shortcut in MoI under Options > Shortcut keys, and put in this:

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

Let me know if that makes the Rhinov7 to Moi direction work ok, if not maybe I don't have the right id value for the v7 clipboard format and we can dig into that some more.

Then if that direction is working ok we can figure out the next step for doing a similar modification to the Rhino Cmd+V shortcut key to get the other direction working too.

- Michael

Attachments:
UpdateRhinoClipboard_Mac.zip


From: shane (SHANE_W)
8 Jan 2021   [#36] In reply to [#35]
Hi Michael, I could not get your clipboard helper to work.

I placed the helper in my:

/Users/shane/Library/Application Support/Moi



I added the following text in my Cmd+V:

script: moi.filesystem.shellExecute( '/Users/shane/Library/Application Support/Moi/UpdateRhinoClipboard', 'target=moi', true /*wait for finish*/ ); moi.command.execCommand( 'paste' );

I also launched the app to make sure it had permission to run.
From: Michael Gibson
9 Jan 2021   [#37] In reply to [#36]
Hi shane, re: clipboard helper, it appears that the space in the path when using the "Application Support" folder gums things up.

Please try placing the UpdateRhinoClipboard binary in some path without any spaces in it, and then update the Cmd+V script to have that path in it. Does it work ok then?

- Michael
From: Michael Gibson
9 Jan 2021   [#38] In reply to [#36]
Hi shane, or a path with spaces in it will probably work if you add double quotes around it, like:

script: moi.filesystem.shellExecute( '"/Users/shane/Library/Application Support/Moi/UpdateRhinoClipboard"', 'target=moi', true /*wait for finish*/ ); moi.command.execCommand( 'paste' );

So that's got single quotes ' ' around the outside, and then double quotes " " inside of that.

I'll see about updating moi.filesystem.shellExecute() to handle that automatically when there are any spaces in the path.

- Michael
From: shane (SHANE_W)
11 Jan 2021   [#39] In reply to [#38]
Thanks Michael, the double quotes did the trick! I tried it on some larger files and it seems to be working great.
From: Michael Gibson
11 Jan 2021   [#40] In reply to [#39]
Hi Shane,

re:
> Thanks Michael, the double quotes did the trick! I tried it on some larger files and it seems to be working great.

That's great!

So for the other direction going from MoI into Rhino, you'll need to set up a Python script like the attached one. It appears that Rhino v7 Mac uses the Rhino v6 Mac clipboard format so put target=Rhinov6 as the command-line parameter to the UpdateRhinoClipboard executable inside the .py file.

Then for your paste into Rhino you'll need it set up something like:

RunPythonScript /Applications/RhinoPasteFromMoi.py Paste

- Michael

Attachments:
RhinoPasteFromMoi.py


From: shane (SHANE_W)
12 Jan 2021   [#41] In reply to [#40]
Thanks Michael for working on this! I haven't tried the MOI > Rhino yet as I rarely go that way. Once my workload lightens up I will give it a try.
From: mdesign
10 Feb 2021   [#42] In reply to [#41]
I`ve tried today and MoI3d -> Rhino v7 went ok without any additional plugin. Thanks Michael for making possible again copy-paste between Rhino->MoI with your additional plugin. It`s very useful.
From: mdesign
12 Mar 2021   [#43]
Hi, after this Copy-Paste tweak I have problem copy-paste inside of MoI3d. Because when I hit copy-paste inside MoI3d then nothing happen (pasted mesh is not pasting). I have to click "save as" and after hitting that button pasting is finishing properly. So I cancel saving and I have pasted mesh. Is there any simpler way to copy-paste inside Moi3d without clicking on "Save As" button to finish pasting operation?
From: Michael Gibson
12 Mar 2021   [#44] In reply to [#43]
Hi mdesign, so this is happening when you modify the Paste command in MoI to run the helper program for enabling copy/paste to Rhino v7?

What operating system are you running on and what version of Moi are you using?

Can you show what you have for your paste keyboard shortcut now?

- Michael
From: mdesign
15 Mar 2021   [#45] In reply to [#44]
Sorry for late reply.

https://www.youtube.com/watch?v=h4njmGKkPKI

Windows x64

1) create cube
2) ctrl-c cube (copy cube)
3) del cube
4) ctrl-v cube (paste cube). Nothing happen. There is no cube in the scene.
5) Click save as - cube will paste properly.

This is very annoying on bigger projects.

Cheers!!!
From: Michael Gibson
15 Mar 2021   [#46] In reply to [#45]
Hi mdesign, so this is happening when you modify the Paste command in MoI to run the helper program for enabling copy/paste to Rhino v7?

Or have you not done any modification to the paste keyboard shortcut ?

If you have modified it can you show what you have in the keyboard shortcut now for Ctrl+V ?

- Michael

Show messages:  1-6  7-26  27-46  47-51