Missing meshes

Hi Everyone.

I wrote a stand-alone app for doing some manipulation of 3DM files. My app uses the Rhino3dmIO.Desktop toolkit, v6.30.20288.16411.

We have a number of 3DM files we want to process. These files have one or two meshes, and a point cloud. My app does rotations and/or translations of the meshes and/or point cloud depending on certain conditions. My app doesn’t detect any errors. When I open the file in Rhino after processing through my app, the meshes have disappeared but the point cloud is still there. When I debug the app, I can see the meshes in the rhinofile object.

Here is a image of the object from the Visual Studio debugger. The Watch window is looking at rhinofile in the code snippet.
https://1drv.ms/u/s!ArDQyMhw_Ocun0jMwAnbh_AE9ZdG?e=chOwmo

I’m not familiar enough with the internals of a 3DM file to know what might be missing.

I have posted a sample 3DM file here:
https://1drv.ms/u/s!ArDQyMhw_Ocun0c1SSSiWx_qEeiB?e=z7fPIl

Thanks for any advice.

Best Regards
Don

Hi @v-dosay,

I see a couple of issues:

1.) You’re using Rhino 6 but your wrote a Rhino 3 file. Probably not the best choice.
2.) I can see you’ve got a couple of instance definitions that appear to have no geometry.
3.) You may have a couple of meshes that have been added to the document as instance definition geometry.

Anyway, with some sample code, that we can run here, we might be able to help you out.

– Dale

Hi Dale.

Thanks for the reply.

What exactly is the version? I’m using the same version data as the source file.

If I view the source 3dm file as text, I see this:

3D Geometry File Format 60 ˜ Rhinoceros 6.29 - Commercial, build 2020-08-25 - (compiled Aug 25 2020)

SDK Version: 2348836105.2356442729

OpenNURBS Version: 2356442729

3dm Version: 6

But in my code, the Revision property of the File3dmObject shows this:
image001.png

I don’t know if I can simply my code enough to be useful here, but I’ll see what I can do.

In general, I load the 3dm like this

File3dm rhinofile = File3dm.Read(rhinoFileName);

Then I do a whole lot of processing against the rhinofile object, and end like this:

rhinofile.Write(destRhinoFile, rhinofile.Revision);

I’m still looking into the ‘reference’ geometries.

Hi @v-dosay,

It is not clear to me how you created or modified the file, being that you have not shared any source code. But here is some code you can use to move the instance definition geometry back to normal, viewable geometry.

Program.cs (1.9 KB)

generic_problem_lm_FIXED.3dm (545.6 KB)

Hope this helps.

– Dale

Thank you Dale.

Once I created the new file, everything works as expected.

I’m a little confused as to what actually happened, as the existing code worked on 3DM files we received from one source. The disappearing meshes occurred when we processed 3DM files from another source.

Don