@agi.andre wrote:
I’m trying to serialize and deserialize geometry by using CommonObjectToByteArray and ByteArrayToCommonObject
But when recreating the object with ByteArrayToCommonObject it only returns True, while it should return an instance of an object?
Anyone who can point me in what I’m doing wrong here?Grateful for some help!
import base64 import Grasshopper as gh import Rhino.Geometry as rg byte_arr = str(gh.Kernel.GH_Convert.CommonObjectToByteArray(obj)) a = base64.b64encode(byte_arr) byte_arr = bytearray(base64.b64decode(a)) obj = gh.Kernel.GH_Convert.ByteArrayToCommonObject<rg.Brep>(byte_arr)
serialize.gh (6.6 KB)
Posts: 1
Participants: 1