Serialize/deserialize on stream

Hi,

In extention to my other post regarding the adding of the ACIS solids, I have a question: Since speckel returns and provides JSON,
Is it possible to serialize to the stream itself? Or is this not possible?

To what end? Embed streams within objects or compressed payload?

could be beneficial for Library management in Speckle itself and a.o. sending the acis solid as a class to the stream directly.
payload compression could be an added benefit, but not my goal per-se

1 Like

You can easily add with our dynamic notation any other properties to your objects! Adding a new property holding the serialised ACIS info is definitively doable:

myC3DBrep["@acis"] = "serialised ACIS notation" 

or if you want to be fancy:

var acisWrapper = new Base();
acisWrapper["serialisedInfo"] = "etc. ";
acisWrapper["source"] = "Civil3D";
myC3DBrep["@acisObject"] = acisWrapper;

A note on payload compression: we do that anyway at the “infrastructure” layer when sending, receiving, & storing - so the gains you would get are minimal if any; i wouldn’t bother!

3 Likes

Very cool, did not know this was as easy as that!
I will give it a go soon!

2 Likes