Extract materials from .3dm


Is there any way to extract materials from 3dm file without loading it to Rhino?
using c++ or .net.
.net is preferable

Looks like it’s possible using OnBinaryFile, it’s very good then could somebody provide with an example of how how to locate materials, enumerate?

What part of the material are you trying to get at? Perhaps I’m not understanding what you mean by “extract.”

In RhinoCommon (C# .NET):
provides an IEnumerator.

Does this help?

I mean extract materials directly from 3dm file without loading it to Rhino
Looks like Rhino.FileIO.File3dm is what I need

And also is there any way using .Net to read plugin custom data from 3dm without loading it to Rhino?
It should be in File3dmPlugInData class but it contains Plugin ID only

To read 3DM files from a standalone application, you need openNURBS. There is both a C++ version and .NET wrapper.

There may be a read to read user data from C++ if it is your data if you wrote it using C++. I have not tried reading RhinoCommon-added user data from Rhino3dmIO, but I doubt it is possible.

NOTE: This is NOT meant for any Rhino plug-in development. You should only be using this library if you are attempting to read/write 3dm files from an application other than Rhino!

Actually I need to read this data in the Rhino plugin but without loading 3dm to Rhino

The aim is to import(extract) our custom plugin data from a 3dm files to the current Rhino scene