Open 3D models from memory


(Victormunoz) #1

I would like to import a 3D model from a memory variable.
Does there exist a function like RhinoDoc.ReadFile that reads the model from a variable instead of a file?
If not, is there any other way to do it?

This question may be related to: Model serialization
But now I am interested in loading a 3D model in its own format (not a RhinoDoc serialization of it), for example an IGES or STEP format, which are plain text files. So I would like to import the model given its content (an string of text) without the need to write the file.


(Dale Fugier) #2

Hi @victormunoz,

You can read 3dm files into memory using a File3dm object.

However, all other formats are handled by file import plug-ins, which either replace the active document or import into the active document. Thus, there isn’t a way to read an IGES file, for example, into memory without writing your own file readers.

Does this answer your question?

– Dale


(Victormunoz) #3

Yes, this answers my question with a “No, you can’t do that”.

Thank you anyway for your time :slight_smile: