Extract materials from .3dm


#1

Hello

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


#2

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?


(Dan Belcher) #3

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):
Rhino.DocObjects.Tables.MaterialTable
provides an IEnumerator.

Does this help?


#4

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


#5

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


(Dale Fugier) #6

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.


#7

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