Rhino.FileIO.File3dm: Looking for a possibility to read/write to/from a stream

I was looking for a possibility to use Rhino.FileIO.File3dm for reading from (and writing to) a stream, which would be very useful for using Rhino3dmIO in the context of a cloud application (e.g. reading a 3dm fetched from S3). It seems this possibility doesn’t exist. Am I missing sth?

Not currently. I did create static FromByteArray functions for the python and javascript versions of the library. Looks like I need to add this functionality to the .NET version of the library.

That would be fantastic, many thanks for your feedback!

@stevebaer one more question about this: would this also become part of Rhino.FileIO.File3dm in RhinoCommon?

This sounds like something that would be a useful addition to openNURBS too. Or is it already there?

Yes, Rhino3dm for .NET is a subset of RhinoCommon and almost everything added to Rhino3dm will be available in RhinoCommon. I should be able to get this added soon as it is really just more testing than typing.

The functionality already exists in OpenNURBS as this is what rhino3dm.py and rhino3dm.js use

RH-60014 is fixed in the latest WIP

Found the new FromByteArray(byte[]) in the latest WIP, many thanks. Would it be possible to also support this the other way around, ie a byte[] ToByteArray() or similar?

Sure

1 Like

Many thanks!

I just added File3dm.ToByteArray() to V7. This will be available in the next public release of Rhino/RhinoCommon.

Thanks,
Steve