FileIO.File3d x RhinoDoc - opennurbs issue

Hello,

I would like to ask few “maybe simple” questins, which I am not sure of the answers. Recently, I deal with task of generating .3dm files from inside of the Rhino/Grasshopper.

I was able to do so (and I am absolutely ok with this approach, but want to know more) using var doc = Rhino.RhinoDoc.CreateHeadless(null), add staff into it and save it as .3dm file.

However, I came across Rhino.FileIO.File3dm class and tried it. It seems to work in similar way when .3dm file needs to be created and stuff added. However, if I put my methods under unit tests with Rhino.Testing library I got errors. First, Visual studio missed .pdb file for opennurbs.dll. I was able to solve this based on this OpenNURBS Debug Symbols - Rhino 7 SDK - openNURBS - McNeel Forum topic.

However, it solves problem only for creating .3dm file and adding layers, linetypes, dimstyles and settings. If I add geometry Visual studio raise another error that opennurbs_wstring.cpp file cannot be found.

So my the question is, what are the differences between Rhino.FileIO.File3dm and Rhino.RhinoDoc approach when I am creating .3dm file and which is better?

As I understand it Rhino.FileIO.File3dm class can be used outside Rhino and with Rhino.Compute. It is also somehow connected to opennurbs library and Visual Studio has a problem with it during debugging and testing. Am I wrong?

Thanks for reply and your time.

Ondrej

Quick update,

same problem with missing opennurbs_wstring.cpp file appears even if I use
doc = Rhino.RhinoDoc.CreateHeadless(null) statement and run my test in debug mode.

So my another question is how to solve it?

Thanks again Ondrej

@fraguada - is this something you can help with?

Rhino.Testing has been written in the Rhino 8 development cycle. I am not sure how of if this is meant to work with Rhino 7 and .net framework 4.8. I’m looking into it.

I have both Rhino 7 and 8 installed. Rhino.Testing references Rhino 8 and my plugin. My plugin is written for Rhino 7 and .net framework 4.8.

This is what I see (not every time) when I hit debug my tests. When I simply run test it works correctly.

Thanks

Ondřej