Rhino3dmIO error during reading notes

Hi everyone,
I’ve found some issue using RhinoCommon DLL for open a .3dm file outside Rhino 5.

The issue is about reading the “Notes” (http://docs.mcneel.com/rhino/5/help/en-us/commands/notes.htm) of 3dm files.

To obtain the right version of libraries outside Rhino 5’s environment I’ve followed the directive from this guide for windows.

I did some tests and I noticed a different behavior, what I want to achieve is the same behavior using the Python engine inside Rhino outside with another python script.
Example:

I did those test using the Rhino3dmIO on a Windows 10 (64 bit), the same hardware where I compile the DLL using Visual Studio 2017.

Using the same script above on a brand new installation of IronPython 2.7.7 I obtain a different behavior:


Only the last line was red.

About using the DLL on Linux (Ubuntu 10/04 LTS), I’ve approached in 2 ways:

  • Using the native Python interpreter
  • Using IronPython

About the first approach, I create a Shared Object librhino3dmio_native.so using this repository https://github.com/arendvw/rhinocommon/tree/rhino3dmio-linux (following this pull request https://github.com/mcneel/rhinocommon/pull/171)
I’ve also tested using different version of python 2.7.1 and 3.5.2 and the lib PythonNet (https://github.com/pythonnet/pythonnet), to build PythonNet I’ve used mono 4.8 and .net 2.0.0

My virtualenv look exactly like this one:

  • pkg-resources==0.0.0
  • pycparser==2.18
  • PyICU==1.9.7
  • pythonnet==2.3.0
  • six==1.11.0

The output of the script was a unreadable string which was different every time I run the script. I’ve also tried to change the python interpreter and downgrade PythonNet to an older version, but the output was the same.

About the second approach, using IronPython 2.7.7. I had another issue, after building IronPython and running the Mono’s script, I got a PosixPath error, which makes it virtually impossible to dynamically load the system paths.

Is possible to obtain a stable DLL for Linux?
The different behavior inside Rhino5 and outside Rhino5 may depend on some components not included during the compilation of Rhino3dmIO?

Best,
Alessandro

p.s.
For Italian reader, my colleague also open a topic on the Italian forum: http://it.discourse.mcneel.com/t/rhino3dmio-errore-lettura-notes/1295

Hi @Alessandro_Ferrini,

You’ve got a lot going on here. So I want to focus on where and how you need to read 3dm files.

Why do you need to read 3dm files? What do you plan on doing with the data once you’ve read them?

What platform do you need to read 3dm files outside of Rhino on? Linux? Windows? Both?

What language do you want to use to access the notes found in a 3dm file?

Thanks,

– Dale

This was probably my fault. There was something wrong in my port of file3dmio in the way utf strings were handled. There’s a commit from 7th of december that fixes this.