rhino3dm.File3dm: Doesn’t it support ToByteArray()?

I’m developing with AWS Lambda python. I want to read and write 3dm to S3 using rhino3dm. I have successfully read from S3 with FromByteArray (). But I couldn’t find ToByteArray () in FIle3dm. Is there any other way?

https://mcneel.github.io/rhino3dm/python/api/File3dm.html

Looks like it is not in the Python API, but it is supported in RhinoCommon.

Thank you Menno. I have a question how to use RhinoCommon in AWS Lambda ?

I don’t know. Maybe @stevebaer or @dale can help with that.

1 Like

I’m looking into this. I’m not very familiar with how to wrap the bytearray type in python for use in rhino3dm which is what is taking time.

In the meantime you could use the Encode and Decode functions to convert your File3dm into a base64 encoded string.

1 Like