MoI discussion forum
MoI discussion forum

Full Version: Copy-paste from Rhino 7 to MoI3d

Show messages:  1-18  19-38  39-51

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
From: BurrMan
31 Dec 2020   [#25] In reply to [#22]
Hi Michael,
Does this work from a js file also, or does it have to be invoked from MoI's "Paste" Ctrl-V
From: Michael Gibson
31 Dec 2020   [#26] In reply to [#25]
Hi Burr, it should work from any kind of script, it is just convenient to bake it into the Ctrl+V so that it does the cilpboard update and the paste all in one action.

- Michael
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

Show messages:  1-18  19-38  39-51