How Open 3dm and small save use OpenNURBS.NET?

Thank you!
But small save is a part of in my Winform program ,so I want to use OpenNURBS.NET.

Saving small is essentially saving all Breps without cached meshes (i.e. render and analysis). Does this help?

Yes!This is what I want.
do you have examples?

You will need to start by building Rhino3dmIO.

Have you done this?

No RenderMeshe or AnalysisMeshes in Rhino3dmIO.

Only RMA.OpenNURBS.OnBinaryArchive have
public bool EnableSave3dmAnalysisMeshes(bool enable)
public bool EnableSave3dmRenderMeshes(bool enable)

my code:

            OpenFileDialog ofd = new OpenFileDialog();

        if (ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK)
        {
            ofd.Dispose();
            return;
        }

        string fn = ofd.FileName;
        OnFileHandle ofh = OnUtil.OpenFile(fn, "wb");

        OnBinaryArchive oba = new OnBinaryFile(IOn.archive_mode.wirte3dm,ofh);//no work
     
        OnXModel oxm = new OnXModel();
        oxm.Read(fn);//OK

        oxm.Write(oba,5);//Return false.  why?

        oba.EnableSave3dmRenderMeshes(false);
        oba.EnableSave3dmAnalysisMeshes(false);
//test
        oxm.Write(@"d:\temp\"+ofd.SafeFileName, 5);//Return true,OK
        oxm.Write(oba,5);//Return false
        ofh.Dispose();
        oxm.Dispose();
        oba.Dispose();
        ofd.Dispose();
......

Hi dale
My problem not solved , Please help me please ,thank you!

I will try to work you up a sample. It might take me a few days to get to it.

Thanks,

– Dale

If you are using the old opennurbs.net DLL, then keep in mind that this was produced before Rhino 5 was released. Thus, the library is only capable of reading and writing files prior to version 5. You cannot use the old opennurbs.dll to read or write Rhino 5 3DM files.

Looking at the new Rhino3dmIO toolkit, it do not see a way of destroying meshes that are cached on Breps. Also, there are no equvalents to EnableSave3dmRenderMeshes(), EnableSave3dmAnalysisMeshes() and EnableSaveUserData(). I will see these are added to the “to-do” list.

So,I need wait for the new Rhino3dmIO toolkit? :frowning:

Yes I believe so. Not unless @stevebaer has any ideas…

You should be able to compile Rhino3dmIo toolkit right now if you have the both visual c# and c++ . We will also be delivering a nuget package for Rhino3dmIo very soon.

@Alain, where are we with respect to releasing nuget packages? Are you just waiting on me?

Hi @Steve, Sorry I missed this thread. The packages are available and to add them to your solution just search for “Rhino3dmIO” in the online packages under nuget.org in VS (Tools -> Library Package Manager -> Manage NuGet Pagkages For Solution …)

2 Likes

Looks like Rhno3dmIo is available on nuget, so you should just be able to use the library in your project.

Thank @Alain, @stevebaer, @dale
I can to compile Rhino3dmIo toolkit ,but there are no equvalents to EnableSave3dmRenderMeshes(), EnableSave3dmAnalysisMeshes() and EnableSaveUserData() in Rhino3dmIo toolkit.

Ok, we’ll look into adding these functions to RhinoCommon and updating the nuget packages. If you are using nuget, hopefully you’ll get a notification of the update.

NuGet will not send “push” style notifications. You have to update manually in VS using Manage NuGet packages, click updates. This can be done on an individual project or for a complete solution.

I just added an overload to File3dm.Write in Rhino3dmIo on github that takes options for saving meshes and user data. @Alain, can you push out a new nuget build when you get a chance? Thanks.

Hi @stevebaer,
I just pushed out new nuget packages.
Cheers

Thank’s very body!

发自我的 Windows Phone