MoI discussion forum
MoI discussion forum

Full Version: Copy-paste from Rhino 7 to MoI3d

Show messages:  1-10  11-30  31-50  51

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
From: mdesign
15 Mar 2021   [#47] In reply to [#46]
I`ve done modification on ctrl-V shortcut as you adviced before to have copy-paste feature between MoI and Rhino 7.

And it works well. But after doing that it broke my pasting inside MoI (with using ctrl-v). Maybe I should give other shortcut for Rhino paste not ctrl-v because I broke paste functionality inside MoI (when I use only MoI and I don`t use MoI-Rhino coop).

Image Attachments:
Zrzut ekranu 2021-03-16 093821.jpg 


From: Michael Gibson
15 Mar 2021   [#48] In reply to [#47]
Hi mdesign, it looks like the shortcut key is not quite right, there's a description for how it needs to be set up earlier in this thread here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=9890.22

The key thing that you're missing:
quote:

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.

So where you have "c:\UpdateRhinoClipboard.exe", you instead need it to be "c:\\UpdateRhinoClipboard.exe" - note the doubled backslash.

There is probably a bug where if you give an invalid path to moi.filesystem.shellExecute() with the "wait for finished" enabled it ends up getting stuck waiting for a non-existent program to finish running and then running some other command cancels out from that wait. I'll see if I can fix that up.

- Michael
From: Michael Gibson
15 Mar 2021   [#49] In reply to [#48]
Hi mdesign, also it looks like you may have 2 sets of quotes around the c:\UpdateRhinoClipboard.exe, one pair of single quote ' characters and another pair of double quote " characters. Modify that to have just one or the other in that spot.

- Michael
From: mdesign
16 Mar 2021   [#50] In reply to [#49]
It works!!! Thank you Michael for your effort with solving my issue. I`ve changed single backslash to double and removed unneeded pair of quotes. It helped to solve that issue exactly as you said.

Cheers!!!

Show messages:  1-10  11-30  31-50  51